box64/tests/test01.c
2021-02-28 13:19:23 +01:00

20 lines
712 B
C

#include <sys/syscall.h>
#include <unistd.h>
int main(int argc, char **argv)
{
const char msg[] = "Hello x86_64 World!\n";
//syscall(1, STDOUT_FILENO, msg, sizeof(msg)-1);
asm (
"mov $1, %%rax \n"
"mov $1, %%rdi \n"
"mov %0, %%rsi \n"
"mov $20, %%rdx \n"
"syscall \n"
:
:"r" (msg)
:"%rax","%rdi","%rsi","%rdx"
);
return 0;
}