[fpc-pascal] How to translate Delphi Assembly MOV EAX,[EBP+4]

Dennis dec12 at avidsoft.com.hk
Wed Jul 18 17:19:26 CEST 2018


The following delphi code when compiled by FPC, raised these errors:
Compile Project, Target: lib\x86_64-win64\Project1.exe: Exit code 1, 
Errors: 10, Warnings: 2
StrBuffer.pas(100,19) Error: Unknown identifier "EAX"
StrBuffer.pas(100,23) Error: Assembler syntax error in operand
StrBuffer.pas(100,24) Error: Unknown identifier "EBP"
StrBuffer.pas(100,29) Error: Invalid constant expression
StrBuffer.pas(100,29) Error: Invalid reference syntax
StrBuffer.pas(100,29) Warning: No size specified and unable to determine 
the size of the operands, using DWORD as default
StrBuffer.pas(207,19) Error: Unknown identifier "EAX"
StrBuffer.pas(207,23) Error: Assembler syntax error in operand
StrBuffer.pas(207,24) Error: Unknown identifier "EBP"
StrBuffer.pas(207,29) Error: Invalid constant expression
StrBuffer.pas(207,29) Error: Invalid reference syntax
StrBuffer.pas(207,29) Warning: No size specified and unable to determine 
the size of the operands, using DWORD as default

Can anyone help me?

class procedure TStrBuffer.Error(const Msg: string; Data: Integer);

   function ReturnAddr: Pointer;
   asm
           MOV     EAX,[EBP+4]
   end;

begin
   raise EListError.CreateFmt(Msg, [Data])at ReturnAddr;
end;



More information about the fpc-pascal mailing list