MSP430 Instructions
4-98
16-Bit MSP430X CPU
RETI
Return from interrupt
Syntax
RETI
Operation
@SP
→
SR.15:0
Restore saved status register SR with PC.19:16
SP + 2
→
SP
@SP
→
PC.15:0
Restore saved program counter PC.15:0
SP + 2
→
SP House keeping
Description
The status register is restored to the value at the beginning of the interrupt
service routine. This includes the four MSBs of the program counter PC.19:16.
The stack pointer is incremented by two afterwards.
The 20-bit PC is restored from PC.19:16 (from same stack location as the
status bits) and PC.15:0. The 20-bit program counter is restored to the value
at the beginning of the interrupt service routine. The program continues at the
address following the last executed instruction when the interrupt was granted.
The stack pointer is incremented by two afterwards.
Status Bits
N:
restored from stack
Z:
restored from stack
C:
restored from stack
V:
restored from stack
Mode Bits
OSCOFF, CPUOFF, and GIE are restored from stack
Example
Interrupt handler in the lower 64 K. A 20-bit return address is stored on the
stack.
INTRPT PUSHM.A
#2,R14
; Save R14 and R13 (20-bit data)
...
; Interrupt handler code
POPM.A
#2,R14
; Restore R13 and R14 (20-bit data)
RETI
; Return to 20-bit address in full memory range
Содержание MSP430x4xx Family
Страница 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Страница 2: ......
Страница 6: ...vi ...
Страница 114: ...3 76 RISC 16 Bit CPU ...
Страница 304: ...5 20 FLL Clock Module ...
Страница 340: ...7 8 Supply Voltage Supervisor ...
Страница 348: ...8 8 16 Bit Hardware Multiplier ...
Страница 372: ...9 24 32 Bit Hardware Multiplier ...
Страница 400: ...10 28 DMA Controller ...
Страница 428: ...13 10 Basic Timer1 ...
Страница 466: ...15 24 Timer_A ...
Страница 522: ...17 30 USART Peripheral Interface UART Mode ...
Страница 544: ...18 22 USART Peripheral Interface SPI Mode ...
Страница 672: ...23 12 Comparator_A ...
Страница 692: ...24 20 LCD Controller ...
Страница 746: ...26 28 ADC12 ...