Instruction Set
3-57
RISC 16−Bit CPU
RETI
Return from interrupt
Syntax
RETI
Operation
TOS
→
SR
SP + 2
→
SP
TOS
→
PC
SP + 2
→
SP
Description
The status register is restored to the value at the beginning of the interrupt
service routine by replacing the present SR contents with the TOS contents.
The stack pointer (SP) is incremented by two.
The program counter is restored to the value at the beginning of interrupt
service. This is the consecutive step after the interrupted program flow.
Restoration is performed by replacing the present PC contents with the TOS
memory contents. The stack pointer (SP) is incremented.
Status Bits
N: restored from system stack
Z: restored from system stack
C: restored from system stack
V: restored from system stack
Mode Bits
OSCOFF, CPUOFF, and GIE are restored from system stack.
Example
Figure 3−13 illustrates the main program interrupt.
Figure 3−13. Main Program Interrupt
PC −6
PC −4
PC −2
PC
PC +2
PC +4
PC +6
PC +8
PC = PCi
PCi +2
PCi +4
PCi +n−4
PCi +n−2
PCi +n
Interrupt Request
Interrupt Accepted
PC+2 is Stored
Onto Stack
RETI
Содержание MSP430x1xx
Страница 1: ... 2005 Mixed Signal Products User s Guide SLAU049E ...
Страница 6: ...vi ...
Страница 18: ...1 6 Introduction ...
Страница 36: ...2 18 System Resets Interrupts and Operating Modes ...
Страница 112: ...3 76 ...
Страница 130: ...4 18 Basic Clock Module ...
Страница 152: ...5 22 Flash Memory Controller ...
Страница 160: ...6 8 Supply Voltage Supervisor ...
Страница 168: ...7 8 Hardware Multiplier ...
Страница 192: ...8 24 ...
Страница 200: ...9 8 Digital I O ...
Страница 234: ...11 24 Timer_A ...
Страница 260: ...12 26 Timer_B ...
Страница 291: ...13 31 USART Peripheral Interface UART Mode ...
Страница 314: ...14 23 USART Peripheral Interface SPI Mode ...
Страница 346: ...15 32 USART Peripheral Interface I2C Mode ...
Страница 358: ...16 12 Comparator_A ...
Страница 386: ...17 28 ADC12 ...
Страница 418: ...18 32 ADC10 ...
Страница 432: ...19 14 DAC12 ...