Mercurial > hg > Members > kono > nitros9-code
comparison level1/modules/boot_1773.asm @ 1287:10957d54bf16
Made all modules rev 0
author | boisy |
---|---|
date | Sat, 30 Aug 2003 20:16:51 +0000 |
parents | 4e235f213651 |
children | 92e9f7416fc9 |
comparison
equal
deleted
inserted
replaced
1286:d5839bc79972 | 1287:10957d54bf16 |
---|---|
1 ******************************************************************** | 1 ******************************************************************** |
2 * Boot - WD1773 Boot for OS-9 | 2 * Boot - WD1773 Boot module |
3 * | 3 * |
4 * $Id$ | 4 * $Id$ |
5 * | 5 * |
6 * Ed. Comments Who YY/MM/DD | 6 * Edt/Rev YYYY/MM/DD Modified by |
7 * Comment | |
7 * ------------------------------------------------------------------ | 8 * ------------------------------------------------------------------ |
8 * 4 From Tandy OS-9 Level Two VR 02.00.01 and | 9 * 4 1985/??/?? |
9 * modified to work properly under OS-9 Level One | 10 * Original Tandy distribution version. |
11 * | |
12 * 6 1998/10/12 Boisy G. Pitre | |
13 * Obtained from L2 Upgrade archive, has 6ms step rate and disk timeout | |
14 * changes. | |
15 * | |
16 * 6r2 2003/05/18 Boisy G. Pitre | |
17 * Added '.' output for each sector for OS-9 L2 and NitrOS9 for | |
18 * Mark Marlette (a special request :). | |
10 | 19 |
11 nam Boot | 20 nam Boot |
12 ttl os9 system module | 21 ttl WD1773 Boot module |
13 | 22 |
14 * Disassembled 98/08/23 21:21:26 by Disasm v1.6 (C) 1988 by RML | 23 IFP1 |
15 | |
16 ifp1 | |
17 use defsfile | 24 use defsfile |
18 use rbfdefs | 25 use rbfdefs |
19 endc | 26 ENDC |
20 | 27 |
21 * Step Rate: | 28 * Step Rate: |
22 * $00 = 6ms | 29 * $00 = 6ms |
23 * $01 = | 30 * $01 = |
24 * $02 = | 31 * $02 = |
25 * $03 = 30ms | 32 * $03 = 30ms |
26 STEP set $00 | 33 STEP set $00 |
27 | 34 |
28 tylg set Systm+Objct | 35 tylg set Systm+Objct |
29 atrv set ReEnt+rev | 36 atrv set ReEnt+rev |
30 rev set $01 | 37 rev set $02 |
31 edition set 4 | 38 edition set 6 |
32 | 39 |
33 mod eom,name,tylg,atrv,start,size | 40 mod eom,name,tylg,atrv,start,size |
34 | 41 |
35 u0000 rmb 2 | 42 u0000 rmb 2 |
36 u0002 rmb 2 | 43 u0002 rmb 2 |
43 size equ . | 50 size equ . |
44 | 51 |
45 name fcs /Boot/ | 52 name fcs /Boot/ |
46 fcb edition | 53 fcb edition |
47 | 54 |
48 * First, we make a stack... | 55 start clra clear A |
49 start clra | 56 ldb #size get our 'stack' size |
50 ldb #size | 57 MakeStak pshs a save 0 on stack |
51 MakeStak pshs a | 58 decb and continue... |
52 decb | 59 bne MakeStak until we've created our stack |
53 bne MakeStak | 60 |
54 | 61 tfr s,u put 'stack statics' in U |
55 tfr s,u | 62 ldx #$FF48 |
56 ldx #DPort+8 | |
57 lda #$D0 | 63 lda #$D0 |
58 sta ,x | 64 sta ,x |
59 lbsr L01A7 | 65 lbsr L01AA |
60 lda ,x | 66 lda ,x |
61 lda #$FF | 67 lda #$FF |
62 sta u0004,u | 68 sta u0004,u |
63 leax >NMIRtn,pcr | 69 leax >NMIRtn,pcr |
64 IFGT Level-1 | 70 IFGT Level-1 |
68 stx >D.XNMI+1 | 74 stx >D.XNMI+1 |
69 lda #$7E | 75 lda #$7E |
70 sta >D.XNMI | 76 sta >D.XNMI |
71 lda #$08 | 77 lda #$08 |
72 ENDC | 78 ENDC |
73 sta >DPort | 79 sta >$FF40 |
74 | 80 |
75 * delay loop | 81 * delay loop |
76 IFGT Level-1 | 82 IFGT Level-1 |
77 ldd #$C350 | 83 ldd #$C350 |
78 ELSE | 84 ELSE |
79 ldd #$61A8 | 85 ldd #$61A8 |
80 ENDC | 86 ENDC |
81 L003A nop | 87 IFNE NitrOS9 |
82 nop | 88 nop |
89 ENDC | |
90 L003A nop | |
91 nop | |
92 IFNE NitrOS9 | |
93 nop | |
94 nop | |
95 nop | |
96 ENDC | |
83 subd #$0001 | 97 subd #$0001 |
84 bne L003A | 98 bne L003A |
85 | 99 |
86 * search for a free page (to use as a 256 byte disk buffer) | 100 * search for a free page (to use as a 256 byte disk buffer) |
87 pshs u,y,x,b,a | 101 pshs u,y,x,b,a |
88 ldd #$0001 | 102 ldd #$0001 |
89 os9 F$SRqMem | 103 os9 F$SRqMem |
90 bcs L00AA | 104 bcs L00AA |
91 tfr u,d | 105 tfr u,d |
92 ldu $06,s | 106 ldu $06,s |
93 std u0002,u | 107 std u0002,u |
94 clrb | 108 clrb |
95 | 109 |
96 * go get LSN0 | 110 * go get LSN0 |
97 ldx #$0000 | 111 ldx #$0000 |
98 bsr L00C4 | 112 bsr ReadSect |
99 bcs L00AA | 113 bcs L00AA |
100 | 114 |
101 * get bootfile size from LSN0 and allocate memory for it | 115 * get bootfile size from LSN0 and allocate memory for it |
102 ldd DD.TOT+1,y | 116 ldd DD.TOT+1,y |
103 std u0007,u | 117 std u0007,u |
111 std ,s | 125 std ,s |
112 ldx <DD.BT+1,y | 126 ldx <DD.BT+1,y |
113 pshs x | 127 pshs x |
114 ldd #256 | 128 ldd #256 |
115 ldu u0002,u | 129 ldu u0002,u |
116 os9 F$SRtMem | 130 os9 F$SRtMem |
117 ldd $02,s | 131 ldd $02,s |
118 IFGT Level-1 | 132 IFGT Level-1 |
119 os9 F$BtMem | 133 os9 F$BtMem |
120 ELSE | 134 ELSE |
121 os9 F$SRqMem | 135 os9 F$SRqMem |
122 ENDC | 136 ENDC |
123 puls x | 137 puls x |
124 bcs L00AA | 138 bcs L00AA |
129 ldd ,s | 143 ldd ,s |
130 beq L00A3 | 144 beq L00A3 |
131 | 145 |
132 * this loop reads a sector at a time from the bootfile | 146 * this loop reads a sector at a time from the bootfile |
133 L0091 pshs x,b,a | 147 L0091 pshs x,b,a |
134 clrb | 148 clrb |
135 bsr L00C4 | 149 bsr ReadSect |
136 bcs L00A8 | 150 bcs L00A8 |
151 IFGT Level-1 | |
152 lda #'. dump out a period for boot debugging | |
153 jsr <D.BtBug do the debug stuff | |
154 ENDC | |
137 puls x,b,a | 155 puls x,b,a |
138 inc u0002,u | 156 inc u0002,u |
139 leax 1,x | 157 leax 1,x |
140 subd #256 | 158 subd #256 |
141 bhi L0091 | 159 bhi L0091 |
142 L00A3 clrb | 160 L00A3 clrb |
143 puls b,a | 161 puls b,a |
144 bra L00AC | 162 bra L00AC |
145 L00A8 leas $04,s | 163 L00A8 leas $04,s |
146 L00AA leas $02,s | 164 L00AA leas $02,s |
147 L00AC | 165 L00AC |
148 IFGT Level-1 | 166 IFGT Level-1 |
149 sta >$FFD9 | 167 sta >$FFD9 unnecessary - rel does this for us |
150 ENDC | 168 ENDC |
151 puls u,y,x | 169 puls u,y,x |
152 leas size,s | 170 leas size,s clean up stack |
153 rts | 171 clr >$FF40 shut off floppy disk |
154 | 172 rts |
155 L00B4 lda #$29 | 173 |
174 L00B7 lda #$29 | |
156 sta ,u | 175 sta ,u |
157 clr u0004,u | 176 clr u0004,u |
158 lda #$05 | 177 lda #$05 |
159 lbsr L016D | 178 lbsr L0170 |
160 ldb #STEP | 179 ldb #STEP |
161 lbra L0192 | 180 lbra L0195 |
162 | 181 |
163 L00C4 lda #$91 | 182 * Read a sector from the 1773 |
164 cmpx #$0000 | 183 * Entry: X = LSN to read |
165 bne L00DC | 184 ReadSect lda #$91 |
166 bsr L00DC | 185 cmpx #$0000 LSN0? |
167 bcs L00D3 | 186 bne L00DF |
187 bsr L00DF | |
188 bcs L00D6 | |
168 ldy u0002,u | 189 ldy u0002,u |
169 clrb | 190 clrb |
170 L00D3 rts | 191 L00D6 rts |
171 | 192 |
172 L00D4 bcc L00DC | 193 L00D7 bcc L00DF |
173 pshs x,b,a | 194 pshs x,b,a |
174 bsr L00B4 | 195 bsr L00B7 |
175 puls x,b,a | 196 puls x,b,a |
176 L00DC pshs x,b,a | 197 L00DF pshs x,b,a |
177 bsr L00E7 | 198 bsr L00EA |
178 puls x,b,a | 199 puls x,b,a |
179 bcc L00D3 | 200 bcc L00D6 |
180 lsra | 201 lsra |
181 bne L00D4 | 202 bne L00D7 |
182 L00E7 bsr L0139 | 203 L00EA bsr L013C |
183 bcs L00D3 | 204 bcs L00D6 |
184 ldx u0002,u | 205 ldx u0002,u |
185 orcc #IntMasks | 206 orcc #IntMasks |
186 pshs y | 207 pshs y |
187 ldy #$FFFF | 208 ldy #$FFFF |
188 ldb #$80 | 209 ldb #$80 |
189 stb >DPort+8 | 210 stb >$FF48 |
190 ldb ,u | 211 ldb ,u |
191 orb #$30 | 212 orb #$30 |
192 tst u0009,u | 213 tst u0009,u |
193 beq L0104 | 214 beq L0107 |
194 orb #$40 | 215 orb #$40 |
195 L0104 stb >DPort | 216 L0107 stb >$FF40 |
196 lbsr L01A7 | 217 lbsr L01AA |
197 orb #$80 | 218 orb #$80 |
198 lda #$02 | 219 lda #$02 |
199 L010E bita >DPort+8 | 220 L0111 bita >$FF48 |
200 bne L0120 | 221 bne L0123 |
201 leay -$01,y | 222 leay -$01,y |
202 bne L010E | 223 bne L0111 |
203 lda ,u | 224 lda ,u |
204 sta >DPort | 225 sta >$FF40 |
205 puls y | 226 puls y |
206 bra L0135 | 227 bra L0138 |
207 L0120 lda >DPort+$B | 228 L0123 lda >$FF4B |
208 sta ,x+ | 229 sta ,x+ |
209 stb >DPort | 230 stb >$FF40 |
210 bra L0120 | 231 bra L0123 |
211 | 232 |
212 NMIRtn leas size+2,s | 233 NMIRtn leas R$Size,s |
213 puls y | 234 puls y |
214 ldb >DPort+8 | 235 ldb >$FF48 |
215 bitb #$04 | 236 bitb #$04 |
216 beq L018C | 237 beq L018F |
217 L0135 comb | 238 L0138 comb |
218 ldb #E$Read | 239 ldb #E$Read |
219 rts | 240 rts |
220 | 241 |
221 L0139 lda #$09 | 242 L013C lda #$09 |
222 sta ,u | 243 sta ,u |
223 clr u0009,u | 244 clr u0009,u |
224 tfr x,d | 245 tfr x,d |
225 cmpd #$0000 | 246 cmpd #$0000 |
226 beq L0169 | 247 beq L016C |
227 clr ,-s | 248 clr ,-s |
228 tst u0008,u | 249 tst u0008,u |
229 beq L015F | 250 beq L0162 |
230 bra L0155 | 251 bra L0158 |
231 L014F com u0009,u | 252 L0152 com u0009,u |
232 bne L0155 | 253 bne L0158 |
233 inc ,s | 254 inc ,s |
234 L0155 subb u0006,u | 255 L0158 subb u0006,u |
235 sbca #$00 | 256 sbca #$00 |
236 bcc L014F | 257 bcc L0152 |
237 bra L0165 | 258 bra L0168 |
238 L015D inc ,s | 259 L0160 inc ,s |
239 L015F subb u0006,u | 260 L0162 subb u0006,u |
240 sbca #$00 | 261 sbca #$00 |
241 bcc L015D | 262 bcc L0160 |
242 L0165 addb #18 | 263 L0168 addb #$12 |
243 puls a | 264 puls a |
244 L0169 incb | 265 L016C incb |
245 stb >DPort+$A | 266 stb >$FF4A |
246 L016D ldb u0004,u | 267 L0170 ldb u0004,u |
247 stb >DPort+9 | 268 stb >$FF49 |
248 cmpa u0004,u | 269 cmpa u0004,u |
249 beq L018A | 270 beq L018D |
250 sta u0004,u | 271 sta u0004,u |
251 sta >DPort+$B | 272 sta >$FF4B |
252 ldb #$10+STEP | 273 ldb #$10+STEP |
253 bsr L0192 | 274 bsr L0195 |
254 pshs x | 275 pshs x |
255 ldx #$222E | 276 ldx #$222E |
256 L0184 leax -1,x | 277 L0187 leax -$01,x |
257 bne L0184 | 278 bne L0187 |
258 puls x | 279 puls x |
259 L018A clrb | 280 L018D clrb |
260 rts | 281 rts |
261 L018C bitb #$98 | 282 L018F bitb #$98 |
262 bne L0135 | 283 bne L0138 |
263 clrb | 284 clrb |
264 rts | 285 rts |
265 L0192 bsr L01A5 | 286 L0195 bsr L01A8 |
266 L0194 ldb >DPort+$8 | 287 L0197 ldb >$FF48 |
267 bitb #$01 | 288 bitb #$01 |
268 bne L0194 | 289 bne L0197 |
269 rts | 290 rts |
270 L019C lda ,u | 291 L019F lda ,u |
271 sta >DPort | 292 sta >$FF40 |
272 stb >DPort+$8 | 293 stb >$FF48 |
273 rts | 294 rts |
274 L01A5 bsr L019C | 295 L01A8 |
275 L01A7 lbsr L01AA | 296 IFNE NitrOS9 |
276 L01AA lbsr L01AD | 297 nop |
277 L01AD rts | 298 ENDC |
278 | 299 bsr L019F |
279 IFGT Level-1 | 300 L01AA |
280 | 301 IFNE NitrOS9 |
281 rts | 302 nop |
282 rts | 303 nop |
283 rts | 304 ENDC |
284 rts | 305 lbsr L01AD |
285 rts | 306 L01AD |
286 rts | 307 IFNE NitrOS9 |
287 rts | 308 nop |
288 rts | 309 nop |
289 rts | 310 ENDC |
290 rts | 311 lbsr L01B0 |
291 rts | 312 L01B0 |
292 rts | 313 IFNE NitrOS9 |
293 rts | 314 nop |
294 rts | 315 ENDC |
295 rts | 316 rts |
296 rts | 317 |
297 rts | 318 IFGT Level-1 |
298 rts | 319 * Filler to get $1D0 |
299 rts | 320 Filler fill $39,$1D0-3-* |
300 rts | |
301 rts | |
302 rts | |
303 rts | |
304 rts | |
305 rts | |
306 rts | |
307 rts | |
308 rts | |
309 rts | |
310 rts | |
311 rts | |
312 | |
313 ENDC | 321 ENDC |
314 | 322 |
315 emod | 323 emod |
316 eom equ * | 324 eom equ * |
317 end | 325 end |
326 |