Next: 2. Reference : The
Up: 11. Using assembler
Previous: 11.1 Assembler statements
Assembler procedures and functions are declared using the
Assembler directive. The Assembler keyword is supported
as of version 0.9.7. This permits the code generator to make a number
of code generation optimizations.
The code generator does not generate any stack frame (entry and exit
code for the routine) if it contains no local variables and no
parameters. In the case of functions, ordinal values must be returned
in the accumulator. In the case of floating point values, these depend
on the target processor and emulation options.
Remark: Before version 0.99.1, Free Pascal did not support
reference to variables by their names in the assembler parts of your code.
Remark: From version 0.99.1 to 0.99.5 (excluding
FPC 0.99.5a), the Assembler directive did not have the
same effect as in Turbo Pascal, so beware! The stack frame would be
omitted if there were no local variables, in this case if the assembly
routine had any parameters, they would be referenced directly via the stack
pointer. This was NOT like Turbo Pascal where the stack frame is only
omitted if there are no parameters and no local variables. As
stated earlier, starting from version 0.99.5a, Free Pascal now has the same
behaviour as Turbo Pascal.
root
1999-06-10