JZ2440 start.S 分析1(arm920t)

.globl _start
_start:	b       reset
	ldr	pc, _undefined_instruction
	ldr	pc, _software_interrupt
	ldr	pc, _prefetch_abort
	ldr	pc, _data_abort
	ldr	pc, _not_used
	ldr	pc, _irq
	ldr	pc, _fiq

...

arm中断向量表:

reset                           0x00 //复位
_undefined_instruction          0x04//未定义指令
_software_interrupt             0x08//软中断
_prefetch_abort                 0x0c//预取值异常
_data_abort                     0x10//数据异常
_not_used                       0x14 //保留
_irq                            0x18 //低优先级外部中断
_fiq                            0x1c //快速中断


.globl / .global 为全局标号定义伪指令

.globl使得符号对连接器(ld)可见,该符号为整个工程可用的全局变量。为了兼容其他汇编器,.globl和.global作用相同。

b 为跳转指令,意思是跳到某个地址去。

ldr 为伪指令装载一个32位的常数和一个地址寄存器

eg1:讲常数0xff0读到R1中

LDR R3,=0xff0

eg2:将place标号地址读到R1中

LDR R2,=place

经验分享 程序员 微信小程序 职场和发展