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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/23/01 16:00
Read: times


 
#12732 - RE: Return vector for interrupts
If you are in an interrupt and you want to know the return address you need to read the stack. At this point I think we all are agree.
The Program Counter is 2 bytes long and the stack is just one byte so it save the PC in two consecutive address. What happen if you read the first byte from the stack ( suppose PCH ) and then before reading the PCL appears an interrupt of higher order?
If this new interrupts don't pass values to the main program using the POP instruction or in other words if it has the same amount of POP instruction as of PUSH there will be no problem and in this case is not necessary to disable interrupts.
But if not it is NECESSARY to disable interrupts ( at least those of higher priority ) to avoid problems.
So I think that is a good practice to disable interrupts before reading the stack.

Comments are welcome.
Good Luck

Daniel




List of 14 messages in thread
TopicAuthorDate
Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      

Back to Subject List