CHAPTER 4 MEMORY BANK SELECT FUNCTION (
µ
PD78F0536, 78F0537, AND 78F0537D ONLY)
Preliminary User’s Manual U17260EJ3V1UD
96
•
Software example
Remark
In the software example above, the AX register is destructed. Multiplexed processing is not supported.
RAMD DSEG
SADDR
R_BNKA: DS
2
; Secures RAM for specifying an address at the calling destination.
R_BNKN: DS
1
; Secures RAM for specifying a memory bank number at the calling destination.
R_BNKRN: DS
1
; Secures RAM for saving a memory bank number at the calling source.
MOV
R_BNKN,#BANKNUM TEST
; Store the memory bank number at the calling destination in RAM.
MOVW
R_BNKA,#TEST
; Stores the address at the calling destination in RAM.
CALL
!BNKCAL
; Branches to an inter-memory bank calling processing routine.
:
:
BNKC CSEG
AT
7000H
BNKCAL:
; Inter-memory bank calling processing routine
MOV
A,R_BNKN
; Acquires the memory bank number at the calling destination.
XCH
A,BANK
; Changes the bank and acquires the memory bank number at the calling source.
MOV
R_BNKRN,A
; Saves the memory bank number at the calling source to RAM.
CALL
!BNKCALS
; Calls a subroutine to branch to the calling destination.
XCH
A,R_BNKRN
;
MOV
BANK,A
; Specifies the memory bank number at the calling source.
RET
; Returns to the calling source.
BNKCALS:
MOVW
AX,R_BNKA
;
Specifies
the
address at the calling destination.
BR
AX
; Branches to the calling destination.
BN3 CSEG
BANK3
TEST:
;
MOV
⋅⋅⋅
:
:
RET
END