function Sum(X, Y: Integer): Integer;
begin
Result := X + Y;
end;
could be written in assembly language as
function Sum(X, Y: Integer): Integer; stdcall;
begin
asm
MOV EAX,X
ADD EAX,Y
MOV @Result,EAX
end;
end;
The following symbols cannot be used in asm statements:
Standard procedures and functions (for example, WriteLn and Chr).
String, floating-point, and set constants (except when loading registers).
Labels that aren't declared in the current block.
The @Result symbol outside of functions.
The following table summarizes the kinds of symbol that can be used in asm statements.
Dostları ilə paylaş: