下载此文档

keil51使用C语言的中断向量.doc


文档分类:IT计算机 | 页数:约11页 举报非法文档有奖
1/11
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/11 下载此文档
文档列表 文档介绍
keil 51使用C语言的中断向量
The vector position of the interrupt source
Interrupt source Keil interrupt number vector address
Hs interp失败。这是因为C51没有告诉寄存器bank已 经改变。如果不使用工作寄存器和没有其他的函数被调用时,优化器 eliminiates德码开关登记银行。
如果在Timerl的中断函数原型中使用使用1,寄存器的推将被MOV PSW切换寄存器银行所替换。
不幸的是,当一个中断入口被加速时用在入口的直接寄存器寻址将失 败。
这是因为C51没有告诉寄存器银行已经改变。如果不工作的寄存器将 被使用,如果没有其他函数被调用,优化器.....
在逻辑上,使用中断例程,参数不能传递给它或返回。当中断发生时, 编译器插入的代码被运行,它将累加器,B, DPTR和PSW (程序状态 字)到堆栈。最后,在退出中断程序,预先存储在栈中被恢复,关闭 “}”引起的视网膜被使用而不是一个正常的退役
逻辑上,一个中断服务程序,不能传递参数进去,也不可返回值。
当中断发生时,编译器插入的代码被运行,它将累加器,B, DPTR和 PSW (程序状态字)入栈。最后,在退出中断程序时,预先存储在栈 中被恢复。最后的“}”结束符号
RETI will be inserted to the end of the interrupt program,
To create an interrupt service program (ISR) using the Keil ' C' language, a static void function is declared using the interrupt keyword and the correct interrupt number. The Keil 'C' compiler automatically generates interrupt vectors, as well as the import and export code of the interrupt program. The Interrupt function property indicates that the function is ISR. The using property is used to specify which register area the ISR uses, which is optional. The valid register area ranges from 1 to 3.
The vector position of the interrupt source
Interrupt source Keil interrupt number vector address
Highest priority 6 0x0033
External interrupt 00 0x0003
Timer 0 overflow 1 OxOOOB
External interrupt 12 0x0013
Timer 1 overflow 3 OxOOlB
Serial port 4 0x0023
Timer 2 overflow 5 0x002B
DMA 7, 0x003B
Hardware breakpoint 8 0x0043
JTAG 9, 0x004B
Software breakpoint 10 0x0053
Monitor timer 12 0x0063
One
The function defined before the call differs greatly from the code that is defined after the call (especially when the optimization level is greater than 3). (I'm not sure why, probably because in the call before calling the function definition already know is used, the calling function on the register may be on the function itself is optimized: and after the call is defined not by function usage of register function calls it the defa

keil51使用C语言的中断向量 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数11
  • 收藏数0 收藏
  • 顶次数0
  • 上传人小健
  • 文件大小88 KB
  • 时间2022-05-20
最近更新