QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2681|回复: 0

step15中的中断向量跳转指令是怎么计算的?

[复制链接]
发表于 2007-7-26 14:07:30 | 显示全部楼层 |阅读模式
01 static void install_irq_handler( void (*isr)(void) )
02 {
/* ARM irq exception vector addr is 0x00000018  */
03  unsigned int * irq_vec_addr = ( unsigned int * ) 0x18;
/* this is isr entry address, could be another address like 0x3c, 0x58... */
04  unsigned int * isr_entry_addr = ( unsigned int * ) 0x38;
05  unsigned int instruction;

/* set the ISR entry at 0x38  */
06  *isr_entry_addr = (unsigned int)isr;

/* make an instruction: it is machine-code for "ldr  pc, [pc, #(38-18-]"  */
07  instruction = ((unsigned int) isr_entry_addr  - (unsigned int)irq_vec_addr - 0x0 | 0xe59ff000;

/* set this instruction at 0x18  */
08  *irq_vec_addr = instruction;

09  return;
10 }
第7行中的指令是根据什么来构建的?别的资料上的中断向量表的初始化和这种方法有什么区别吗?谢谢指教。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-2 00:22 , Processed in 0.041493 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表