Interrupt Return - Philips CEM2100/00 Service Manual

Mini system
Hide thumbs Also See for CEM2100/00:
Table of Contents

Advertisement

Example :Save/store register using data transfer instructions
PINTxx:
Saving/Restoring general-purpose registers using PUSH/POP data transfer instruction
Figure 3-4 Saving/Restoring General-purpose Registers under Interrupt Processing

3.3.3 Interrupt return

Interrupt return instructions [RETI]/[RETN] perform as follows.
As for address trap interrupt (INTATRAP), it is required to alter stacked data for program counter (PC) to
restarting address, during interrupt service program.
Note:If [RETN] is executed with the above data unaltered, the program returns to the address trap area and
INTATRAP occurs again.When interrupt acceptance processing has completed, stacked data for PCL and
PCH are located on address (SP + 1) and (SP + 2) respectively.
Example 1 :Returning from address trap interrupt (INTATRAP) service program
PINTxx:
LD
(GSAVA), A
(interrupt processing)
LD
A, (GSAVA)
RETI
Main task
Interrupt
acceptance
Interrupt return
[RETI]/[RETN] Interrupt Return
1. Program counter (PC) and program status word
(PSW, includes IMF) are restored from the stack.
2. Stack pointer (SP) is incremented by 3.
POP
WA
LD
WA, Return Address
PUSH
WA
(interrupt processing)
RETN
Page 41
; Save A register
; Restore A register
; RETURN
Interrupt
service task
Saving
registers
Restoring
registers
; Recover SP by 2
;
; Alter stacked data
; RETURN
T5CL8

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cem2100Cem2100/98

Table of Contents