汇编源代码hello.s:
.section .data
output:
.asciz "hello world !"
.section .text
.globl _start
_start:
pushl $output
call printf
call exit
运行代码指令:
$ as -gstabs -o hello.o hello.s
$ ld -dynamic-linker /lib/ld-linux.so.2 -o hello -lc hello.o
$ ./hello
运行结果显示:hello world!