.data
msg :.string "Hello World!"
len = . - msg
.text
.global _start
_start:
movl $len, %edx
movl $msg, %ecx
movl $1, %ebx
movl $4, %eax
int $0x80
movl $0,%ebx
movl $1,%eax
int $0x80
存为hello.s
然后:as -o hello.o hello.s(汇编成.o文件)
然后:ld -s -o hello hello.o(链接成可执行文件)
然后运行:./hello
呵,OK了!