linux下AT&T汇编之helloworld

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

你可能感兴趣的:(汇编语言,Linux笔记,计算机基础)