ARM GNU彙編程序框架
.section .data
<初始化的數據>
.section .bss
<未初始化的數據>
.section .text
.global _start
_start:
<彙編代碼><入口地址>
彙編程序的示例
//start.s
.bass
.text
.global _start
_start:
mov r1,#1
mov r2,#2
add r3,r1,r2
_loop:
b _loop
//Makefile
all:start.o
arm-linux-ld -Ttext 0x30000000 -o start.elf start.o
start.o:start.s
arm-linux-gcc -g -o start.o -c start.s
clean:
rm -rf *.o *.elf