NEC PD17062 User Manual
Page 119

119
µ
PD17062
Example Saving the status in an interrupt processing routine
EI
M046
M047
M048
M04D
M04E
M05F
BTM0CK
MEM
MEM
MEM
MEM
MEM
MEM
MEM
0.46H
0.47H
0.48H
0.4DH
0.4EH
0.5FH
0.89H
# POKE
$ PEEK
% POKE
& MOV
( ST
) ST
M048,
WR,
M04E,
RPL,
M046,
M047,
WR
RPL
WR
#0EH
AR1
AR0
.
.
.
* PEEK
+ ST
WR,
M05F,
BTM0CK
WR
BANK0
MOV
LD
LD
RPL,
AR1,
AR0,
#0EH
M046
M047
.
.
.
LD
POKE
WR,
BTM0CK,
M05F
WR
.
.
.
PEEK
POKE
PEEK
WR,
RPL,
WR,
M04E
WR
M048
RETI
EI
Main routine
Program example
Interrupt
processing
routine
(enters a DI state)
BANK and IXE
saving by
hardware
Saving contents
of required system
register using
software
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
Restoration of
contents of saved
system registers
Interrupt reception
Interrupt
processing
Saves the contents of the window register in M048.
Saves the contents of the general-purpose register pointer in M04E.
Sets row address 7 of bank 0 in the general-purpose register
Saves the contents of required system registers.
Saves the contents of the required control register.
Restores the contents of the saved control register.
Restores the contents of the general register-purpose pointer.
Restores the contents of the saved window register.
The EI instruction permits an interrupt (INTE setting)
after the next RETI instruction is executed.
Restoration by the BANK or IXE hardware
;
;
;
;
Makes bank 0 available.
Sets row address 7 of bank 0 in the general-purpose register.
Restores the contents of the saved system registers.
.
.
.