Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/02/05 08:15
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#86350 - bad things
Responding to: ???'s previous message
hi,

Mehdi said:
END_ISR:
POP 7
POP 7
POP 7


Why do you pop up 3 values? Return address takes only two bytes on the stack.

Anyway, there is general mistake in your logic: an interrupt may occure at any time and so you may not be sure about how much values are placed on the stack when ISR runs. I mean that an interrupt may be called inside main loop as well as inside the deepest subroutine. So, if you really need with bad things you do, then reload stack value as well! Something like that:
END_ISR:
MOV SP,#default_value
MOV R7,#50H
PUSH 7
MOV R7,#0H
PUSH 7
SETB P3.3
RETI

Regards,
Oleg

List of 14 messages in thread
TopicAuthorDate
Hanging Up My 8051?            01/01/70 00:00      
   an ISR returns to where it happened            01/01/70 00:00      
      correction            01/01/70 00:00      
      Re:hanging up my 8051.            01/01/70 00:00      
         no such assumption            01/01/70 00:00      
   2 things            01/01/70 00:00      
      experience is not everything!            01/01/70 00:00      
         somebody like you!            01/01/70 00:00      
   If you know exactly what you do...            01/01/70 00:00      
      he is going to do it            01/01/70 00:00      
         The rare case            01/01/70 00:00      
   bad things            01/01/70 00:00      
      On reloading default (e.g. SP)            01/01/70 00:00      
      Thanks Oleg            01/01/70 00:00      

Back to Subject List