简体   繁体   中英

delphi asm code win32 vs win64

My project in Delphi 10.1 has some assembly functions like this:

  function MyFunc: Word;
  asm
    PUSH   0
    FNSTCW [ESP].Word
    POP    EAX
  end;

I need compile project in win64, but some lines like POP EAX has E2116 Invalid combination of opcode and operands Error.

Rather than translating the assembly to x64, you should use the Get8087CW() function in the System unit instead. It should work fine for both platforms (Win32/Win64):

function MyFunc: Word;
begin
  Result := Get8087CW;
end;

In order to translate any other assembly code (which you didn't provide here) from x86 to x64, I suggest you to learn x64 assembling programming.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM