[fpc-pascal]Var parameter passing to asm procedure

Nelson M. Sicuro nelson at desktopsistemas.com.br
Thu Aug 5 18:28:25 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]'.

Regards,

Nelson

>> The asm block can be this way:
>>
>> procedure increment(var x: dword); assembler;
>> asm
>>    inc [eax]
>> end;
>>
>> You don't need to worry about segment registers, but don't mess with  
>> them!
>> I assume that the parameter x is passed on the eax register as Delphi  
>> does.
>> Please correct me if I'm wrong...
>
> You are wrong.
>
> He is using 1.0.x, which doesn't have register parameters. That is 1.9.2  
> or
> 1.9.4+
>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>






More information about the fpc-pascal mailing list