ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
65
M8C Instruction Set
4.28
Return from Interrupt
RETI
When the M8C takes an interrupt, three bytes are pushed onto the stack. One for CPU_F and two for
the PC. When a RETI is executed, the last three bytes placed on the stack are used to change the
CPU_F register and the CPU_PC register. The first byte removed from the stack is used to restore
the CPU_F register. The SP (CPU_SP register) is decremented after the first byte is removed. The
lower 8 bits of the PC are popped off the stack next, followed by the SP being decremented by one
again. Finally, the upper 8 bits of the PC are popped off the stack, followed by a last decrement of
the SP. The Carry and Zero Flags are updated with the values from the first byte popped off the
stack.
For PSoC devices with more than 256 bytes of RAM, the stack is confined to a single designated
stack page defined by the value of the STK_PP Register. The M8C automatically selects the stack
page as the source for the pop during the
RETI
instruction. Therefore, an
RETI
instruction may be
issued in any RAM page. After the
RETI
instruction has completed, user code will be operating from
the same RAM page as before the
RETI
instruction was executed.
See the RAM Paging chapter of the
PSoC Technical Reference Manual (TRM)
for details.
Instructions
Operation
Opcode
Cycles Bytes
Mnemonic
Argument
RETI
0x7E
10
1
Conditional
Flags:
CF
ZF
All Flag bits are restored to the value pushed during an interrupt call.
All Flag bits are restored to the value pushed during an interrupt call.
SP
SP 1
F
ram SP
SP
SP 1
PC 7:0
ram SP
SP
SP 1
PC 15:8
ram SP
–
–
–
Summary of Contents for PSoC DESIGNER ImageCraft M8C
Page 6: ...6 ImageCraft Assembly Language Guide Document 001 44475 Rev B Contents Feedback ...
Page 10: ...10 ImageCraft Assembly Language Guide Document 001 44475 Rev B Introduction Feedback ...
Page 24: ...24 ImageCraft Assembly Language Guide Document 001 44475 Rev B M8C Microprocessor Feedback ...
Page 95: ...ImageCraft Assembly Language Guide Document 001 44475 Rev B 95 Assembler Directives Feedback ...
Page 96: ...96 ImageCraft Assembly Language Guide Document 001 44475 Rev B Assembler Directives Feedback ...
Page 104: ...104 ImageCraft Assembly Language Guide Document 001 44475 Rev B Feedback ...
Page 108: ...108 ImageCraft Assembly Language Guide Document 001 44475 Rev B Index Feedback ...