Free Pascal supports Intel syntax for the Intel family of Ix86 processors in its asm blocks.
The Intel syntax in your asm block is converted to AT&T syntax by the compiler, after which it is inserted in the compiled source. The supported assembler constructs are a subset of the normal assembly syntax. In what follows we specify what constructs are not supported in Free Pascal, but which exist in Turbo Pascal:
mov al, byte ptr MyWord -- allowed,
mov al, byte(MyWord) -- allowed,
mov al, shortint(MyWord) -- not allowed.
const s= 10; const t = 32767;
in Turbo Pascal:
mov al, byte(s) -- useless typecast.
mov al, byte(t) -- syntax error!
In Free Pascal the compiler emits a syntax error in both cases will give out a syntax error.
mov al,byte ptr ['c'] -- not allowed.
mov al,byte ptr [100h] -- not allowed.
(This is due to the limitation of the GNU Assembler).
mov al,[ds:bx] -- not allowed
use instead:
mov al,ds:[bx]
Where Sreg is optional and specifies the segment override. Notes:
const myscale = 1;
...
mov al,byte ptr [esi+ebx*myscale] -- not allowed.
use:
mov al, byte ptr [esi+ebx*1]
Possible fields are as follows:
@: -- not allowed
use instead:
@1: -- allowed
lds si,@mylabel -- not allowed
mov al,[byte ptr myvar] -- not allowed.
use:
mov al,byte ptr [myvar] -- allowed.
The Intel inline assembler supports the following macros: