
ICE Emulator for 8051
33
©1989-2019 Lauterbach GmbH
Bank drivers are special subroutines (max. length 256 bytes) to set the bank or an external MMU:
External
External banked systems use a register or output pins of the CPU to generate the upper memory
addresses. These lines must be feedback to the emulator with the bank probe. Unused inputs of the bank
probe must be grounded (or jumpered to ground pin).
This example uses a common program area on 0--3fffh a banked area from 4000--7fff with 4 banks
This example selects the bank by
internal
port 3 bit 2 and 4:
org 5ffh
db 1
; select internal mode
bank:
org 600h
; destination area in system memory
push dpl
push dph
mov a,r6
mov dptr,4000h
lcall 700h
pop dph
pop dpl
ret
; physical bank
; set DPTR to banked area
; subroutine to write byte to target
; system setting the page register
; in the EPROM
; return
map.res
map.mirror p:0x0--0x3fff p:0x10000
map.mirror p:0x0--0x3fff p:0x20000
map.mirror p:0x0--0x3fff p:0x30000
system.bankfile banksel.bnk
system.up
; reset mapper
; mirror for common area
; load bank file
; bank switching program
input:
r0,r1
r6
r4
r5
; address
; bank
; read/write
; program/data
usable:
r7,a,b,psw