1.源码实现
#hello.s
.data
msg : .string "Hello, world!\n"
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
2.编译源码
$ gcc -c hello.s
$ ld -o hello hello.o
3.执行程序
$ ./hello
Hello, world!
网友评论