ASSEMBLY LANGUAGE AVR What information is pushed on to the s

?ASSEMBLY LANGUAGE AVR

What information is pushed on to the stack when the CPU encounters an interrupt? What registers we need to definitely save on the stack in the ISR? Maximum number of characters (including HTML tags added by text editor): 32, 000

Solution

=========================================================
What information is pushed on to the stack when the CPU encounters an interrupt?
What registers we need to definitely save on the stack in the ISR?


-------------
Answer:
-------------

      
       When interrupt occures , An instruction pointer(IP) is saved in the stack.
IP points to the next instruction of the main program which is being executing during
the interrupt occures.

   -----------------------------------------------------------------------------------------------
   Following are the registers must be saved to stack in the ISR
   -----------------------------------------------------------------------------------------------

  
   01.Stack Pointer(SP) and Program Counter(PC) registers must be saved in the Interrupt Service Routine.
  
02. As a sequence of action, Stack Pointer(SP) is decremented or increments depends on the
       return address address. If it is high byte Stack Pointer(SP) incremented.
       And if it is low byte Stack Pointer(SP) decremented.
      
03. As a sequence of action, Progrma Counter(PC) must store in the stack. Program Counter(PC) saves the
       address of the next instruction to be executed.
      
       And update the Program counter to the starting address of the intrrupt handler routine.
      
=========================================================

?ASSEMBLY LANGUAGE AVR What information is pushed on to the stack when the CPU encounters an interrupt? What registers we need to definitely save on the stack i

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site