[fpc-pascal]Var parameter passing to asm procedure

Marco van de Voort marcov at stack.nl
Fri Aug 6 11:18:01 CEST 2004


> 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)





More information about the fpc-pascal mailing list