-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmmu_test.asm
80 lines (72 loc) · 1.11 KB
/
mmu_test.asm
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
org 0
ld sp, 0x5000
jp main
print:
push bc
ld bc, 0x0800
out (c), e
pop bc
ret
main:
ld bc, 0xbcde
ld e, 0xab
call print
ld e, b
call print
; ld bc,
call chngpgtbl
call pagetable_test
;----
jp fill_ram_end
chngpgtbl:
; ld bc, 0xff03
ld a, 0x65
ld (0xfffc), a
ld e, 0x12
call print
ld a, 0x05
ld (0xfe06), a
ret
pagetable_test:
push hl
push bc
push af
push de
ld HL, fill_ram
ld bc, fill_ram_end
pgtst_loop:
ld e, (HL)
call print
inc H
ld a, b
cp h
jp nz, pgtst_loop
pop de
pop af
pop bc
pop hl
ret
;---------------------
;----RAM fill loop----
;---------------------
org 0x0200
fill_ram:
dc 0x100, 0x02
dc 0x100, 0x03
dc 0x100, 0x04
dc 0x100, 0x05
dc 0x100, 0x06
dc 0x100, 0x07
dc 0x100, 0x08
dc 0x100, 0x09
dc 0x100, 0x0a
dc 0x100, 0x0b
dc 0x100, 0x0c
dc 0x100, 0x0d
dc 0x100, 0x0e
dc 0x100, 0x0f
dc 0x100, 0x10
dc 0x100, 0x11
dc 0x100, 0x12
fill_ram_end:
org 0x1300