forked from juhovh/spectrum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloader.asm
88 lines (69 loc) · 840 Bytes
/
loader.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
81
82
83
84
85
86
87
88
; pointers to system ROM routines
ROM_CLS equ $0d6b
ROM_CHAN_OPEN equ $1601
; interrupt jump table to $8181
org $8000
rept 257
db $81
endm
; main loader routine
loader call ROM_CLS
ld a,2
call ROM_CHAN_OPEN
ld b,11
ldr_nl_loop ld a,13
rst 16
djnz ldr_nl_loop
ld hl,ldr_str
ldr_str_loop ld a,(hl)
cp 0
jr z,ldr_kb_loop
rst 16
inc hl
jr ldr_str_loop
ldr_kb_loop halt
xor a
in a,($fe)
cpl
and 15
jr z,ldr_kb_loop
di
push af
push bc
push de
push hl
push ix
exx
ex af,af'
push af
push bc
push de
push hl
push iy
call init
ld a,$80
ld i,a
im 2
ei
call main
di
im 1
call clean
pop iy
pop hl
pop de
pop bc
pop af
ex af,af'
exx
pop ix
pop hl
pop de
pop bc
pop af
ei
ret
ldr_str db ' PRESS ANY KEY TO START ',0
; our custom interrupt handler
org $8181
jp interrupt