hello.s
.section .rodata
str: .ascii "Hello,world!\n"
.section .text
.globl _start
_start:
movl $4,%eax
movl $1,%ebx
movl $str,%ecx
movl $13,%edx
int $0x80
movl $1,%eax
movl $0,%ebx
int $0x80
makefile文件:
hello:hello.o
ld hello.o -o hello
hello.o:hello.s
as hello.s -o hello.o
clean:
rm hello.o hello