mirror of
https://github.com/ptitSeb/box64.git
synced 2024-11-27 08:40:59 +00:00
20 lines
712 B
C
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;
|
|
}
|