中断服务程序的关键是:1.保护进入中断时的状态,并在退出中断之前恢复进入时的状态。2.必须在中断程序中设定是否允许中断重入,即设置EX0位。 本例中使用了I...
代码说明:
中断服务程序的关键是:1.保护进入中断时的状态,并在退出中断之前恢复进入时的状态。2.必须在中断程序中设定是否允许中断重入,即设置EX0位。 本例中使用了INT0中断,一般中断程序进入时应保护PSW,ACC以及中断程序使用但非其专用的寄存器。本例的INT0程序保护了PSW,ACC,2等三个寄存器并且在退出前恢复了这三个寄存器。另外中断程序中涉及到关键数据的设置时应关中断,即设置时不允许重入。本例中没有涉及这种情况。 实验开始时K8应在H(高电平)端,要产生中断时先拨向L(低电平)端再拨回H端。 -Interrupt service s key is: 1. the protection enters when the interrupt condition, and when the withdrawal interrupt before regains enters the condition. 2. must in the interrupt routine establish whether to permit the interrupt re-entry, namely establishes the EX0 position. in this example has used the INT0 interrupt, generally the interrupt routine enters when should protect PSW, ACC as well as the interrupt routine use but non-its special-purpose register. This example INT0 program protection PSW, ACC,2 and so on three registers, and restored these three registers before the withdrawal. Moreover in the interrupt routine involves to when the essential data establishment should close the interrupt, namely when establishment does
下载说明:请别用迅雷下载,失败请重下,重下不扣分!