-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
chgbnk.mac
40 lines (37 loc) · 1.08 KB
/
chgbnk.mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.z80
name('chgbnk')
title CHGBNK - OEM Supplied Bank Switching Module
;
;-----------------------------------------------------------------------
;
; This is a manufacturer-supplied bank switching module. This module
; is placed at the tail of every local banks of DOS2-ROM.
;
; This is a sample program. DOS2-ROM has no assumptions on the
; mechanism of bank switching, for example, where the bank register is,
; which bits are assigned to bank switching, etc. The bank register
; does not have to be readable.
;
; Entry: Acc = 0 --- switch to bank #0
; 1 --- switch to bank #1
; 2 --- switch to bank #2
; 3 --- switch to bank #3
; Exit: None
;
; Only AF can be modified
;
; *** CODE STRTS HERE *** CAUTION!! This must be the first module.
;
BNKREG equ 6000h ;System IC version
BNKID equ 40FFh ;Where Bank ID is stored
;Bank change for Sunrise ID, it is quite weird:
;bank bit 0 -> register bit 7
;bank bit 1 -> register bit 6
;bank bit 2 -> register bit 5
CHGBNK:
ld (BNKREG),a
ret
;
defs (8000h-7FD0h)-($-CHGBNK),0FFh
;
end