hello.s
------------------------------------
.section .data
hello:
.ascii "hello world\n"
len = . - hello
.section .text
.global _start
_start:
mov r0, #1 @stdout
ldr r1, =hello
ldr r2, =len
mov r7, #4
swi #0
exit:
mov r0, #0
mov r7, #1
swi #0
------------------------------------
Makefile:
------------------------------------
all:
as hello.s -o hello.o
ld hello.o -o hello
------------------------------------
没有评论:
发表评论