The following code wont work:
Code: Select all
ulong Syscall(ulong id, ulong a, ulong b, ulong c, ulong d)
{
ulong rv;
asm
{
"syscall" : "=a" rv : "a" ID "D" a "S" b "d" c "r10" d;
}
return rv;
}
Code: Select all
ulong Syscall(ulong id, ulong a, ulong b, ulong c, ulong d)
{
ulong rv;
asm
{
"syscall" : "=a" rv : "a" ID "D" a "S" b "d" c "r10" d;
}
return rv;
}
Code: Select all
register uint64_t __return4 asm("r8");
asm volatile("syscall":
"=a" (return0), "=D" (return1), "=S" (return2), "=d" (return3), "=r" (__return4):
"a" (number), "D" (param0):
"rcx", "r11");
return4 = __return4
Thanks for your help anyway, nice to see people from lowlevel hereasm
{
"syscall" :
"=a" return0, "=d" return1 :
"a" id, "D" param0, "S" param1, "d" param2, "b" param3 :
"rcx", "r11";
}
Code: Select all
asm("int $0x80":"=S"(r):"a"(no), "b"(a1), "c"(a2), "d"(a3));