jz2440裸机开发与分析: 点亮LED灯之C语言1
编译 链接 取反汇编
arm-none-linux-gnueabi-gcc -g -nostdlib -c -o led.o led.c
arm-none-linux-gnueabi-gcc -g -nostdlib -c -o start.o start.s
arm-none-linux-gnueabi-ld -Ttext 0 -g start.o led.o -o led.elf
arm-none-linux-gnueabi-objcopy -O binary -S led.elf led.bin
arm-none-linux-gnueabi-objdump -D led.elf > led.dis
反汇编源码分析(led.dis)
led.elf: file format elf32-littlearm
Disassembly of section .text:
00000000 <_start>:
0: e3a0da01 mov sp, #4096 ; 0x1000 //sp = 4096
4: eb000000 bl c <main> //跳转main函数 并且 lr = 8
00000008 <halt>:
8: eafffffe b 8 <halt>
0000000c <main>:
c: e1a0c00d mov ip, sp //ip = 4096
10: e92dd800 stmdb sp!, {fp, ip, lr, pc}