[fpc-pascal]Var parameter passing to asm procedure
Tomas Hajny
XHajT03 at mbox.vol.cz
Fri Aug 6 12:23:52 CEST 2004
On Fri, 6 Aug 2004 11:18:01 +0200 (CEST), Marco van de Voort wrote
> > Ok, then this can be this way:
> >
> > procedure increment(var x: dword); assembler;
> > asm
> > mov eax, x
> > inc [eax]
> > end;
> >
> > Is this correct? If the compiler uses registers, the first line is
> > translated to a 'mov eax, eax', otherwise it is something like 'mov eax,
> > [esp-4]'.
>
> Afaik, it is correct, unless there is something with inc [eax] (e.g.
> not working on older ones)
Almost OK - you need to specify the operand size explicitely ("inc dword ptr
[eax]" in Intel syntax, or "incl (%eax)" in AT&T syntax).
Tomas
More information about the fpc-pascal
mailing list