30000034: e3a02456 mov r2, #1442840576 ; 0x56000000
30000038: e3a03c15 mov r3, #5376 ; 0x1500
3000003c: e92d4030 stmdb sp!, {r4, r5, lr}
30000040: e1a05002 mov r5, r2
30000044: e3a04000 mov r4, #0 ; 0x0
30000048: e5823050 str r3, [r2, #80]
3000004c: e3a00c75 mov r0, #29952 ; 0x7500
30000050: e2800030 add r0, r0, #48 ; 0x30
30000054: ebffffe9 bl 30000000
30000058: e1e03204 mvn r3, r4, lsl #4
3000005c: e2844001 add r4, r4, #1 ; 0x1
30000060: e3540008 cmp r4, #8 ; 0x8
30000064: 02444008 subeq r4, r4, #8 ; 0x8
30000068: e5853054 str r3, [r5, #84]
3000006c: eafffff6 b 3000004c
30000070: 43434700 cmpmi r3, #0 ; 0x0
30000074: 4728203a undefined
30000078: 2029554e eorcs r5, r9, lr, asr #10
3000007c: 2e342e33 mrccs 14, 1, r2, cr4, cr3, {1}
30000080: 00000035 andeq r0, r0, r5, lsr r0
将程序错误部分修改正确之后(将标红的“long”都改成“char”)程序正确,板子上也可以正常运行;但是正确代码生成的反汇编文件中同样位置(Disassembly of section second:)的代码跟错误程序生成的反汇编文件里的代码是一样的,如下:
Disassembly of section second:
30000000
30000000: e24dd004 sub sp, sp, #4 ; 0x4
30000004: e58d0000 str r0, [sp]
30000008: e59d3000 ldr r3, [sp]
3000000c: e3530000 cmp r3, #0 ; 0x0
30000010: 0a000005 beq 3000002c
30000014: e59d3000 ldr r3, [sp]
30000018: e2433001 sub r3, r3, #1 ; 0x1
3000001c: e58d3000 str r3, [sp]
30000020: e59d2000 ldr r2, [sp]
30000024: e3520000 cmp r2, #0 ; 0x0
30000028: 1afffff9 bne 30000014
3000002c: e28dd004 add sp, sp, #4 ; 0x4
30000030: e1a0f00e mov pc, lr
30000034
30000034: e3a02456 mov r2, #1442840576 ; 0x56000000
30000038: e3a03c15 mov r3, #5376 ; 0x1500
3000003c: e92d4030 stmdb sp!, {r4, r5, lr}
30000040: e1a05002 mov r5, r2
30000044: e3a04000 mov r4, #0 ; 0x0
30000048: e5823050 str r3, [r2, #80]
3000004c: e3a00c75 mov r0, #29952 ; 0x7500
30000050: e2800030 add r0, r0, #48 ; 0x30
30000054: ebffffe9 bl 30000000
30000058: e1e03204 mvn r3, r4, lsl #4
3000005c: e2844001 add r4, r4, #1 ; 0x1
30000060: e3540008 cmp r4, #8 ; 0x8
30000064: 02444008 subeq r4, r4, #8 ; 0x8
30000068: e5853054 str r3, [r5, #84]
3000006c: eafffff6 b 3000004c
30000070: 43434700 cmpmi r3, #0 ; 0x0
30000074: 4728203a undefined
30000078: 2029554e eorcs r5, r9, lr, asr #10
3000007c: 2e342e33 mrccs 14, 1, r2, cr4, cr3, {1}
30000080: 00000035 andeq r0, r0, r5, lsr r0
那么我的问题是:如果反汇编文件里这段代码(Disassembly of section second:)是说明main.o已经成功复制到了0x30000000处的话,那么说明错误的程序最终也将main.o复制到了0x30000000,按道理程序应该能正常跳转到main函数运行,而实际上却不能,那么这段反汇编文件到底说明的是什么呢?