NEC 78K0 Series User Manual page 92

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

Advertisement

CHAPTER 4 MEMORY BANK SELECT FUNCTION (
• Software example (to store a value to be referenced in register A)
RAMD
DSEG
SADDR
R_BNKA:
DS
2
R_BNKN:
DS
1
R_BNKRN: DS
1
;
MOV
R_BNKN,#BANKNUM DATA1
MOVW
R_BNKA,#DATA1
CALL
!BNKRD
BNKC
CSEG
AT
BNKRD:
PUSH
HL
MOV
A,R_BNKN
XCH
A,BANK
MOV
R_BNKRN,A
MOVW
AX,R_BNKA
XCHW
HL,AX
MOV
A,[HL]
XCH
A,R_BNKRN
MOV
BANK,A
MOV
A,R_BNKRN
POP
HL
RET
DATA
CSEG
BANK3
DATA1:
DB
0AAH
END
Remark
In the software example above, the X register is destructed.
92
; Secures RAM for specifying an address at the reference destination.
; Secures RAM for specifying a memory bank number at the reference destination.
; Secures RAM for saving a memory bank number at the reference source.
; Stores the memory bank number at the reference destination.
; Stores the address at the reference destination.
; Calls a subroutine for referencing between memory banks.
:
:
7000H
; Subroutine for referencing between memory banks.
; Saves the contents of register HL.
;
; Swaps the memory bank number at the reference source for that at the reference
; destination
; Saves the memory bank number at the reference source.
;
; Specifies the address at the reference destination.
; Reads the target value.
; Acquires the memory bank number at the reference source.
; Specifies the memory bank number at the reference source.
;
; Restores the contents of register HL.
; Return
Preliminary User's Manual U17260EJ3V1UD
µ
PD78F0536, 78F0537, AND 78F0537D ONLY)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents