why a 8051 interrupt following RETI instruction can't be excuted immediately?

Status
Not open for further replies.

Jasper Chow

Junior Member level 3
Joined
Nov 14, 2013
Messages
26
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Activity points
218
By the keil's specification of 8051 instruction set,
"...If another interrupt was pending when the RETI instruction is executed, one instruction at the return address is executed before the pending interrupt is processed.''
The atmel 8051 hardware mannual also states, a long jump action triggered by an interrupt can only occur when the the prior instruction is the final cycle of an instruction other than REIT.
I don't understand why cpu needs to do an extra instruction after RETI before starting another interrrupt.
 

It probably makes the logic simpler. To handle a new interrupt directly would be a special case. It is also useful for implementing single-step functionality.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…