RAD Studio (Common)
|
You can write complete procedures and functions using inline assembly language code, without including a begin...end statement. This topic covers these issues:
An example of the type of function you can write is as follows:
function LongMul(X, Y: Integer): Longint; asm MOV EAX,X IMUL Y end;
The compiler performs several optimizations on these routines:
PUSH EBP ;Present if Locals <> 0 or Params <> 0 MOV EBP,ESP ;Present if Locals <> 0 or Params <> 0 SUB ESP,Locals ;Present if Locals <> 0 . . . MOV ESP,EBP ;Present if Locals <> 0 POP EBP ;Present if Locals <> 0 or Params <> 0 RET Params ;Always present
If locals include variants, long strings, or interfaces, they are initialized to zero but not finalized.
Assembly language functions return their results as follows.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|