Linux 64bit Calling Convention

Maxime Chevalier maximechevalierb at gmail.com
Wed Feb 27 17:03:07 PST 2013


I did some further testing:

void foo(int a, int b)
{
     writefln("a: %s", a);
     writefln("b: %s", b);
}

unittest
{
     foo(1, 2);

     asm
     {
         mov RDI, 1;
         mov RSI, 2;
         call foo;
     }
}

Produces:

a: 1
b: 2
a: 2
b: 1

Unless I'm mistaken, DMD does not respect the C calling 
convention on Linux/AMD64.


More information about the Digitalmars-d mailing list