On Fri, 15 May 2009 14:24:16 +0400, Vladimir A. Reznichenko 
<[email protected]> wrote:

> I have a function:
>
> void test (inout uint a)
> {
>       asm
>       {
>               mov a, 0x25;
>       }
> }
>
> The trouble is that the function's call doesn't change the a variable.
> Any ideas?
>

I believe your code is incorrect. This is how it should be done:

import std.stdio;

void test (out uint a)
{
    asm
    {
        mov EDX, a;
        mov [EDX], 0x25;
    }
}

void main()
{
    uint a = 0;
    test(a);
    
    writefln("0x%x", a);
}

Perhaps, errors like yours could be flagged at compile time? If so, an 
enhancement request would be nice.

Reply via email to