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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/11/02 20:47
Read: times


 
#32332 - RE: Push, Pop commands help
David:

The stack is often used within a subroutine to save the values of registers or memory locations while those registers or memory locations are used for other uses inside the subroutine. This can be particularly handy when they are used in an interrupt processing routine where the main program has been suspended in favor of running code to handle the interrupt condition. Usually in the interrupt routine there is no way of knowing what the various memory and registers were being used for at the time that the interrupt started. Thus if the interrupt routine needs to use ACC and B registers you might write it as:
Intr_Routine:
    push acc
    push b

      ....
      body of handler code free to use ACC
      and B registers
      ....

    pop b
    pop acc
    reti


Good Luck
Mike Karas





List of 7 messages in thread
TopicAuthorDate
Push, Pop commands help            01/01/70 00:00      
RE: Push, Pop commands help            01/01/70 00:00      
RE: Push, Pop commands help            01/01/70 00:00      
RE: Push, Pop commands help            01/01/70 00:00      
RE: Push, Pop commands help            01/01/70 00:00      
RE: HLL Stack Usage            01/01/70 00:00      
RE: Push, Pop commands help            01/01/70 00:00      

Back to Subject List