分类: LINUX
2008-08-25 17:28:10
#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
#end
编译:
as -o hello.o hello.s
连接:
ld -s -o hello hello.o
运行:
./hello