Subsections

12 Using assembler

Free Pascal supports the use of assembler in code, but not inline assembler macros. To have more information on the processor specific assembler syntax and its limitations, see the Programmers' guide.

1 Assembler statements

The following is an example of assembler inclusion in pascal code.
 ...
 Statements;
 ...
 Asm
   the asm code here
   ...
 end;
 ...
 Statements;
The assembler instructions between the Asm and end keywords will be inserted in the assembler generated by the compiler. Conditionals can be used ib assembler, the compiler will recognise it, and treat it as any other conditionals.

2 Assembler procedures and functions

Assembler procedures and functions are declared using the Assembler directive. 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.



Free Pascal Compiler
2001-09-22