为啥我用老师的代码反汇编结果与老师的反汇编代码不同?
led.c
- int main()
- {
- unsigned int *pGPFCON = (unsigned int *)0x56000050;
- unsigned int *pGPFDAT = (unsigned int *)0x56000054;
- /* 配置GPF4为输出引脚 */
- *pGPFCON = 0x100;
- /* 设置GPF4输出0 */
- *pGPFDAT = 0;
- return 0;
- }
复制代码
start.S
- .text
- .global _start
- _start:
- /* 设置内存: sp 栈 */
- ldr sp, =4096 /* nand启动 */
- // ldr sp, =0x40000000+4096 /* nor启动 */
- /* 调用main */
- bl main
- halt:
- b halt
复制代码
我的反汇编
- led.elf: file format elf32-littleARM
- Disassembly of section .text:
- 00000000 <_start>:
- 0: e3a0da01 mov sp, #4096 ; 0x1000
- 4: eb000000 bl c
- 00000008
:
- 8: eafffffe b 8
- 0000000c
:
- c: e52db004 push {fp} ; (str fp, [sp, #-4]!)
- 10: e28db000 add fp, sp, #0 ; 0x0
- 14: e24dd00c sub sp, sp, #12 ; 0xc
- 18: e3a03456 mov r3, #1442840576 ; 0x56000000
- 1c: e2833050 add r3, r3, #80 ; 0x50
- 20: e50b300c str r3, [fp, #-12]
- 24: e3a03456 mov r3, #1442840576 ; 0x56000000
- 28: e2833054 add r3, r3, #84 ; 0x54
- 2c: e50b3008 str r3, [fp, #-8]
- 30: e51b200c ldr r2, [fp, #-12]
- 34: e3a03c01 mov r3, #256 ; 0x100
- 38: e5823000 str r3, [r2]
- 3c: e51b2008 ldr r2, [fp, #-8]
- 40: e3a03000 mov r3, #0 ; 0x0
- 44: e5823000 str r3, [r2]
- 48: e3a03000 mov r3, #0 ; 0x0
- 4c: e1a00003 mov r0, r3
- 50: e28bd000 add sp, fp, #0 ; 0x0
- 54: e8bd0800 pop {fp}
- 58: e12fff1e bx lr
复制代码
老师的反汇编
- led.elf: file format elf32-littlearm
- Disassembly of section .text:
- 00000000 <_start>:
- 0: e3a0da01 mov sp, #4096 ; 0x1000
- 4: eb000000 bl c
- 00000008
:
- 8: eafffffe b 8
- 0000000c
:
- c: e1a0c00d mov ip, sp
- 10: e92dd800 stmdb sp!, {fp, ip, lr, pc}
- 14: e24cb004 sub fp, ip, #4 ; 0x4
- 18: e24dd008 sub sp, sp, #8 ; 0x8
- 1c: e3a03456 mov r3, #1442840576 ; 0x56000000
- 20: e2833050 add r3, r3, #80 ; 0x50
- 24: e50b3010 str r3, [fp, #-16]
- 28: e3a03456 mov r3, #1442840576 ; 0x56000000
- 2c: e2833054 add r3, r3, #84 ; 0x54
- 30: e50b3014 str r3, [fp, #-20]
- 34: e51b2010 ldr r2, [fp, #-16]
- 38: e3a03c01 mov r3, #256 ; 0x100
- 3c: e5823000 str r3, [r2]
- 40: e51b2014 ldr r2, [fp, #-20]
- 44: e3a03000 mov r3, #0 ; 0x0
- 48: e5823000 str r3, [r2]
- 4c: e3a03000 mov r3, #0 ; 0x0
- 50: e1a00003 mov r0, r3
- 54: e24bd00c sub sp, fp, #12 ; 0xc
- 58: e89da800 ldmia sp, {fp, sp, pc}
复制代码
0
|