sys_write in betterC doesn't write anything

Basile B. b2.temp at gmx.com
Sat Feb 3 15:30:10 UTC 2018


compiles with -betterC -m32

module runnable;

__gshared static msg = "betterC";
__gshared static len = 7;

extern(C) int main(int argc, char** args)
{
     asm
     {
         naked;
         mov EDX, len ;//message length
         mov ECX, msg ;//message to write
         mov EBX, 1   ;//file descriptor (stdout)
         mov EAX, 4   ;//system call number (sys_write)
         int 0x80     ;//call kernel

         mov EBX, 0   ;//process' exit code
         mov EAX, 1   ;//system call number (sys_exit)
         int 0x80     ;//call kernel - this interrupt won't return
     }
}

nothing is printed. Could this work ?


More information about the Digitalmars-d-learn mailing list