sys_write in betterC doesn't write anything
Basile B.
b2.temp at gmx.com
Sat Feb 3 15:39:36 UTC 2018
On Saturday, 3 February 2018 at 15:38:02 UTC, Adam D. Ruppe wrote:
> 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.
Yeah, I forgot the ABI. It's working well
https://forum.dlang.org/post/edjipahtfphiqmxsiioq@forum.dlang.org
More information about the Digitalmars-d-learn
mailing list