Using Push And Pop Instructions - Toshiba TLCS-870/C Series Manual

8 bit microcontroller
Hide thumbs Also See for TLCS-870/C Series:
Table of Contents

Advertisement

3.4.2.1

Using PUSH and POP instructions

If only a specific register is saved or interrupts of the same source are nested, general-purpose registers
can be saved/restored using the PUSH/POP instructions.
Example :Save/store register using PUSH and POP instructions
PINTxx:
SP
PCL
PCH
PSW
At acceptance of
an interrupt
Figure 3-3 Save/store register using PUSH and POP instructions
3.4.2.2
Using data transfer instructions
To save only a specific register without nested interrupts, data transfer instructions are available.
Example :Save/store register using data transfer instructions
PINTxx:
PUSH
WA
(interrupt processing)
POP
WA
RETI
SP
A
W
PCL
PCH
PSW
At execution of
PUSH instruction
LD
(GSAVA), A
(interrupt processing)
LD
A, (GSAVA)
RETI
Page 41
; Save WA register
; Restore WA register
; RETURN
SP
PCL
PCH
SP
PSW
At execution of
POP instruction
; Save A register
; Restore A register
; RETURN
TMP86PM29BUG
Address
(Example)
b-5
b-4
b-3
b-2
b-1
b
At execution of
RETI instruction

Advertisement

Table of Contents
loading

Table of Contents