以下代码片断摘自IAR EWARM中某项目的cstartup.s79文件: ;******************************************************************************************************** ; ARM EXCEPTION VECTORS ;********************************************************************************************************
MODULE ?RESET COMMON INTVEC:CODE:NOROOT(2) PUBLIC __program_start EXTERN ?cstartup
IMPORT OS_CPU_ARM_ExceptUndefInstrHndlr IMPORT OS_CPU_ARM_ExceptSwiHndlr IMPORT OS_CPU_ARM_ExceptPrefetchAbortHndlr IMPORT OS_CPU_ARM_ExceptDataAbortHndlr IMPORT OS_CPU_ARM_ExceptIrqHndlr IMPORT OS_CPU_ARM_ExceptFiqHndlr
CODE32
ORG 0x00 __program_start: LDR PC, [PC,#24] ; Absolute jump can reach 4 GByte ORG 0x04 LDR PC, [PC,#24] ; Branch to undef_handler ORG 0x08 LDR PC, [PC,#24] ; Branch to swi_handler ORG 0x0C LDR PC, [PC,#24] ; Branch to prefetch_handler ORG 0x10 LDR PC, [PC,#24] ; Branch to data_handler ORG 0x18 LDR PC, [PC,#24] ; Branch to irq_handler ORG 0x1C LDR PC, [PC,#24] ; Branch to fiq_handler
ORG 0x20 DC32 ?cstartup ORG 0x24 DC32 OS_CPU_ARM_ExceptUndefInstrHndlr ORG 0x28 DC32 OS_CPU_ARM_ExceptSwiHndlr ORG 0x2C DC32 OS_CPU_ARM_ExceptPrefetchAbortHndlr ORG 0x30 DC32 OS_CPU_ARM_ExceptDataAbortHndlr ORG 0x38 DC32 OS_CPU_ARM_ExceptIrqHndlr ORG 0x3C DC32 OS_CPU_ARM_ExceptFiqHndlr
ENDMOD
指令“LDR PC, [PC,#24]”中的常数24是如何计算得来? |