11.07.2015 Views

uPD789074 Subseries 8-Bit Single-Chip Microcontrollers UD - Home

uPD789074 Subseries 8-Bit Single-Chip Microcontrollers UD - Home

uPD789074 Subseries 8-Bit Single-Chip Microcontrollers UD - Home

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 3 CPU ARCHITECTURE(3) Stack pointer (SP)This is a 16-bit register to hold the start address of the memory stack area. Only the internal high-speedRAM area can be set as the stack area.Figure 3-11. Stack Pointer ConfigurationSP15SP15 SP14 SP13 SP12 SP11 SP10 SP9 SP8 SP7 SP6 SP5 SP4 SP3 SP2 SP10SP0The SP is decremented before writing (saving) to the stack memory and is incremented after reading(restoring) from the stack memory.Each stack operation saves/restores data as shown in Figures 3-12 and 3-13.Caution Since RESET input makes the SP contents undefined, be sure to initialize the SP beforeinstruction execution.Figure 3-12. Data to Be Saved to Stack MemoryPUSH rpinstructionCALL, CALLTinstructionsInterruptSP SP _ 3SP SP _ 2SP SP _ 2SP _ 3PC7 to PC0SP _ 2Lower halfregister pairsSP _ 2PC7 to PC0SP _ 2PC15 to PC8SP _ 1Upper halfregister pairsSP _ 1PC15 to PC8SP _ 1PSWSPSPSPFigure 3-13. Data to Be Restored from Stack MemoryPOP rpinstructionRET instructionRETI instructionSPLower halfregister pairsSPPC7 to PC0SPPC7 to PC0SP + 1Upper halfregister pairsSP + 1PC15 to PC8SP + 1PC15 to PC8SP SP + 2SP SP + 2SP + 2PSWSP SP + 348User’s Manual U14801EJ3V1<strong>UD</strong>

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

Saved successfully!

Ooh no, something went wrong!