Using ref and out parameters from inline assembly code

Jarrett Billingsley kb3ctd2 at yahoo.com
Tue Feb 12 17:45:37 PST 2008


"Harry Vennik" <htvennik at zonnet.nl> wrote in message 
news:fot28m$1m2h$1 at digitalmars.com...
> Hi,
>
> What is the right way to assign a value to a ref or out parameter from 
> inline assembly code?
>
> Can it just be referenced by its name like any other variable? Or would
>
> mov EAX, some_out_param
>
> move the address of the var into EAX? (i.e. out_param being handled as a 
> pointer, and swapping those operands would overwrite the pointer with the 
> value from EAX?)

I'd try it if I were you and see what happens, but my guess is that the 
compiler won't perform any magic here and you'll end up with the address of 
the variable in EAX.  ref and out params are implemented as pointers, so 
you'll probably need to dereference them as such in ASM. 




More information about the Digitalmars-d-learn mailing list