extern printf global hello section .text hello: push message call printf add esp, 8 ret section .data message: db 'Hello, World', 10, 0
nasm -f win64 hello.asm
gcc main.c hello.obj -o hello.exe
hello.obj:hello.asm:(.text+0x1): relocation truncated to fit: IMAGE_REL_AMD64_ADDR32 against `.data' collect2.exe: error: ld returned 1 exit status
#include <stdio.h> void hello(); int main() { hello(); getchar(); return 0; }
db 'Hello, World', 12, 0
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)