[ARM裸機程序][6]ARM GNU彙編程序示例

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章