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