forked from A2osX/A2osX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
A2osX.S.QC.txt
179 lines (145 loc) · 3.26 KB
/
A2osX.S.QC.txt
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
PR#3
PREFIX /A2OSX.BUILD
NEW
INC 1
AUTO 8
.LIST OFF
*--------------------------------------
* ****** START OF MLI QUIT CODE ******
* Load Address :$1000-$12FF
*--------------------------------------
.PH $1000
*--------------------------------------
* Kernel Stage 1
*--------------------------------------
A2osX.QC.Start .EQ *
A2osX.QC cld
jmp A2osX.QC.Start1
A2osX.QC.Prefix .BS 64
A2osX.QC.Start1 sei
ldx #$FF
txs
cli
bit RROMBNK1
>LDYAI A2osX.QC
>STYA POWERUP
jsr SETPWRC
lda #$01
sta MEMTABL+$17 protect ProDOS MLI Page
ldx #$16
.1 stz MEMTABL,x Reset ProDOS memory bitmap
dex
bne .1
lda #$CF protect zero page, stack and page 1
sta MEMTABL
lda #$8C Reset 80 col screen ($0C=FF=HOME)
jsr $C300
>LDAXI MSG.INIT1
jsr A2osX.QC.PrintAX
.3 jsr MLI
.DA #MLISETPREFIX
.DA MLISETPREFIX00
bcc .4
>LDAXI MSG.SETPREFIXKO
jsr A2osX.QC.PrintAX
>LDAXI A2osX.QC.Prefix
jsr A2osX.QC.PrintAX
>DEBUG
bra .3
.4 >LDAXI MSG.SETPREFIXOK
jsr A2osX.QC.PrintAX
jsr A2osX.QC.KLoad
bcs *
* >LDYAI GO.Reset
* >STYA POWERUP
* bit RROMBNK1
* jsr SETPWRC
.8 >LDAXI MSG.INIT1OK
jsr A2osX.QC.PrintAX
>DEBUGOA
jmp $2000
*--------------------------------------
A2osX.QC.KLoad >LDAXI MSG.KLOAD
jsr A2osX.QC.PrintAX
ldx A2osX.QC.Prefix
ldy #0
.2 inx
iny
lda SYSKERNEL,y
sta A2osX.QC.Prefix,x
cpy SYSKERNEL
bne .2
stx A2osX.QC.Prefix
>LDAXI A2osX.QC.Prefix
jsr A2osX.QC.PrintAX
jsr MLI
.DA #MLIOPEN
.DA MLIOPEN00
bcs .9
lda MLIOPEN00+5
sta MLIREAD00+1
sta MLICLOSE00+1
jsr MLI
.DA #MLIREAD
.DA MLIREAD00
php
pha
jsr MLI
.DA #MLICLOSE
.DA MLICLOSE00
pla
plp
bcc .9
>LDAXI MSG.KLOAD.KO
jsr A2osX.QC.PrintAX
.9 rts
*--------------------------------------
A2osX.QC.PrintAX
sta TmpPtr1
stx TmpPtr1+1
lda (TmpPtr1)
tax
beq .9
ldy #1
.1 lda (TmpPtr1),y
ora #$80
jsr COUT
iny
dex
bne .1
.9 jsr CROUT
rts
*--------------------------------------
MLISETPREFIX00 .DA #1
.DA A2osX.QC.Prefix
*--------------------------------------
MLIOPEN00 .DA #3
.DA A2osX.QC.Prefix
.DA $C00
.BS 1
*--------------------------------------
MLIREAD00 .DA #4
.BS 1
.DA $2000
.DA $8000
.BS 2
*--------------------------------------
MLICLOSE00 .DA #1
.BS 1
*--------------------------------------
SYSKERNEL >PSTR "SYS/KERNEL"
*--------------------------------------
MSG.INIT1 >PSTR "A2osX[Stage1]:Init"
MSG.SETPREFIXOK >PSTR "Set Prefix OK"
MSG.SETPREFIXKO >PSTR "Insert Vol:"
MSG.KLOAD >PSTR "Loading Kernel..."
MSG.KLOAD.KO >PSTR "Error While Loading Kernel."
MSG.INIT1OK >PSTR "A2osX[Stage1]:Complete."
*--------------------------------------
.BS $1300-*
.EP
*--------------------------------------
MAN
SAVE /A2OSX.SRC/A2OSX.S.QC
LOAD /A2OSX.SRC/A2OSX.S
ASM