Assembling in Delphi 3.0

Hi,

Does any one know how to use PUSH instruction built-in Delphi 3.0 to push a double data type (64bit) to the stack whose resgister is only 32bit?

Thanks.
NYangAsked:
Who is Participating?
 
vladikaConnect With a Mentor Commented:
Let exists such code

procedure Test(T: Double);
begin
end;

procedure Push1;
var T: Double;
begin
  T := 1;
  Test(T);
end;

It's equivalent
procedure Push2;
var T: Double;
begin
  T := 1;
  asm
    push dword ptr T.4
    push dword ptr T
    call Test
  end;
end;

So, use PUSH instruction 2 times

0
 
rickpetCommented:
If your not worried about losing the high bits you can type it to a pointer...

var
  myComp: comp

.

  pointer(myComp);
0
 
NYangAuthor Commented:
Many thanks to vladika for solving my problem.

NYang
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.