20.07.2015 Views

M16C/62 Group DATASHEET

M16C/62 Group DATASHEET

M16C/62 Group DATASHEET

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

InterruptMitsubishi microcomputers<strong>M16C</strong> / <strong>62</strong> <strong>Group</strong>SINGLE-CHIP 16-BIT CMOS MICROCOMPUTERSaving RegistersIn the interrupt sequence, only the contents of the flag register (FLG) and that of the program counter(PC) are saved in the stack area.First, the processor saves the four higher-order bits of the program counter, and 4 upper-order bits and 8lower-order bits of the FLG register, 16 bits in total, in the stack area, then saves 16 lower-order bits of theprogram counter. Figure 1.14.6 shows the state of the stack as it was before the acceptance of theinterrupt request, and the state the stack after the acceptance of the interrupt request.Save other necessary registers at the beginning of the interrupt routine using software. Using thePUSHM instruction alone can save all the registers except the stack pointer (SP).AddressMSBStack areaLSBAddressMSBStack areaLSBm – 4m – 4Program counter (PCL)[SP]New stackpointer valuem – 3m – 3Program counter (PCM)m – 2m – 2Flag register (FLGL)m – 1mm + 1Content of previous stackContent of previous stack[SP]Stack pointervalue beforeinterrupt occursm – 1mm + 1Flag register(FLGH)Programcounter (PCH)Content of previous stackContent of previous stackStack status before interrupt requestis acknowledgedStack status after interrupt requestis acknowledgedFigure 1.14.6. State of stack before and after acceptance of interrupt request61

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!