NEC 78K0 Series User Manual page 97

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0 Series:
Table of Contents

Advertisement

CHAPTER 4 MEMORY BANK SELECT FUNCTION (
4.3.4 Instruction branch to bank area by interrupt
When an interrupt occurs, instructions can branch to the memory bank specified by the BANK register by using the
vector table, but it is difficult to identify the BANK register when the interrupt occurs.
Therefore, specify the branch destination address specified by the vector table in the common area (0000H to
7FFFH), specify the memory bank at the branch destination by using the BANK register in the common area, and
execute the CALL instruction. At this time, save the BANK register value before the change to RAM, and restore the
value of the BANK register before executing the RETI instruction.
Remark
Allocate interrupt servicing that requires a quick response in the common area.
Bank
area
Common
area
• Software example (when using interrupt request of 16-bit timer/event counter 00)
VCTBL
CSEG
AT
DW
BNKITM000
RAMD
DSEG
SADDR
R_BNKRN: DS
1
BNKC
CSEG
AT
BNKITM000:
PUSH
AX
MOV
A,BANK
MOV
R_BNKRN,A
MOV
BANK,#BANKNUM TEST
CALL
!TEST
MOV
A,R_BNKRN
MOV
BANK,A
POP
AX
RETI
BN3
CSEG
BANK3
TEST:
MOV ⋅⋅⋅
:
:
RET
END
Memory bank m
Vector table
0020H
; Specifies an address at the timer interrupt destination.
; Secures RAM for saving the memory bank number before the interrupt occurs.
7000H
; Inter-memory bank interrupt servicing routine
; Saves the contents of the AX register.
; Saves the memory bank number before the interrupt to RAM.
; Specifies the memory bank number of the interrupt routine.
; Calls the interrupt routine.
; Restores the memory bank number before the interrupt.
; Restores the contents of the AX register.
; Interrupt servicing routine
Preliminary User's Manual U17260EJ3V1UD
µ
PD78F0536, 78F0537, AND 78F0537D ONLY)
Memory bank n
Instruction branch
Save the original memory bank number.
Specify the address and memory bank
at the destination, and execute the call
instruction.
97

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents