... Statements; ... Asm your asm code here ... end; ... Statements;The assembler instructions between the Asm and end keywords will be inserted in the assembler generated by the compiler. You can still use conditionals in your assembler, the compiler will recognise it, and treat it as any other conditionals.
Remark: Before version 0.99.1, Free Pascal did not support reference to variables by their names in the assembler parts of your code.
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: 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.