I try to do some things with the GCC Inline Assembly, in this case I will do Syscall, but I want to force the use of 64-bit registers (rax, rdi, rsi, ...) instead of 32-bit (eax, edi, ...), but I tried many ways, and nothing.
void syscall(uint64_t arg1, uint64_t arg2) {
__asm__("syscall" : : "a" (arg1), "D" (arg2));
}
When I compile, I get:
mov eax, 60
syscall
I have a function, so "edi" is obtained from the arguments, but as you can see it is "eax", I want to use rax.
How can I force 64-bit registers instead of 32-bit?
source
share