Steward
分享是一種喜悅、更是一種幸福
程式語言 - GNU - Assembly (x86) - Hello, world!(printf)
參考資訊:
https://chromium.googlesource.com/chromiumos/docs/+/HEAD/constants/syscalls.md
main.s
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | . global main . extern printf .data msg: . asciz " hello , world!\n" .text main : push % ebp mov % esp , % ebp push $msg call printf xor % eax , % eax mov % ebp , % esp pop % ebp ret |
編譯、執行
$ i686-linux-gnu-gcc main.s -o main -static $ qemu-i386 ./main hello, world!