#include <stdio.h>
void main() {
const char *hello = "Hello, World!\n";
asm(
"mov $1, %%rax\n"
"mov $1, %%rdi\n"
"mov %0, %%rsi\n"
"mov $14, %%rdx\n"
"syscall\n"
:
: "r"(hello)
: "%rax", "%rdi", "%rsi", "%rdx"
);
}
![Cover image for Running inline assembly code in C](https://media.dev.to/cdn-cgi/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8m8n8jhyyj6t404j2692.png)
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)