sys_write in betterC doesn't write anything

Adam D. Ruppe destructionator at gmail.com
Sat Feb 3 15:38:02 UTC 2018


On Saturday, 3 February 2018 at 15:30:10 UTC, Basile B. wrote:
> __gshared static msg = "betterC";

That's a D string....

>         mov ECX, msg ;//message to write

And that's the address of a D string, instead of the address of 
the characters.

You need to put the pointer in there. So either make msg a char*, 
or pass msg.ptr there. With inline asm the ptr word will cause 
weirdness so I tend to move the pointer and length into local 
variables first.


More information about the Digitalmars-d-learn mailing list