0
|
1 ********************************************************************
|
|
2 * RAM - RAM Disk driver
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
1348
|
6 * Edt/Rev YYYY/MM/DD Modified by
|
|
7 * Comment
|
0
|
8 * ------------------------------------------------------------------
|
1348
|
9 * 4 1998/10/10 Boisy G. Pitre
|
|
10 * Given to me by Gene Heskett.
|
0
|
11
|
|
12 opt d68
|
|
13 opt w110
|
|
14 * set printer to 15 cpi!
|
|
15 h6309 set 0
|
|
16
|
|
17 nam RAM
|
|
18 ttl RAM Disk driver
|
|
19
|
|
20 **********************************************
|
|
21 * A version of MyRam that can be asm to run on either
|
|
22 * cpu. To switch to 6309 coding, use "h6309 set 1"
|
|
23 * As no irq's are handled here, compensatory
|
|
24 * changes to register offsets vs stack are not
|
|
25 * required, therefore not used as defines either.
|
|
26 * This does require an "os39defs" that can switch
|
|
27 * register offsets etc according to the value
|
|
28 * assigned to "h6309" and "TRUE", and a late
|
|
29 * copy of Chris Burkes "xsm" assembler
|
|
30
|
|
31 ifp1
|
|
32 use defsfile
|
|
33 use rbfdefs
|
|
34 endc
|
|
35
|
|
36 rev set $02
|
|
37 edition set 4
|
|
38
|
|
39 ****************************************
|
|
40 * this is required because regular
|
|
41 * os-9 doesn't treat a native mode
|
|
42 * marked module correctly, result
|
|
43 * crash at worst, device table full
|
|
44 * and nothing else works at best.
|
|
45
|
|
46 ifeq h6309-TRUE
|
|
47 tylg set Drivr+Obj_309
|
|
48 atrv set ReEnt+Ntv_mode+rev
|
|
49 else
|
|
50 tylg set Drivr+Objct
|
|
51 atrv set ReEnt+rev
|
|
52 endc
|
|
53
|
|
54 RD.MAP set -2 ,x of course!
|
|
55 FDlocat set -3 loc for root FD
|
|
56 DIRloca set -4 loc for root
|
|
57 mod eom,name,tylg,atrv,start,size
|
|
58 org 0
|
|
59 u0000 rmb 2
|
|
60 u0002 rmb 2
|
|
61 u0004 rmb 2
|
|
62 u0006 rmb 5
|
|
63 u000B rmb 2
|
|
64 u000D rmb 2 is RD.MAP & FDLocat
|
|
65 u000F rmb 1
|
|
66 u0010 rmb 32
|
|
67 OurDesc rmb 2
|
|
68 OurLink rmb 1 to control our self link
|
|
69 Initstt rmb 2
|
|
70 u0035 rmb 1
|
|
71 u0036 rmb 2 number of 8k ramblocks needed
|
|
72 u0038 rmb 2 only 2 used
|
|
73 u003A rmb 2
|
|
74 FatScra rmb 2 define FatScratch pad areas
|
|
75 MP.SIZ rmb 2 ditto
|
|
76 u0040 rmb 6
|
|
77 u0046 rmb 10 actually 1, our tasknum
|
|
78 u0050 rmb $C0-.
|
|
79 u00C0 rmb $100-.
|
|
80 size equ .
|
|
81 mode fcb $BF
|
|
82
|
|
83 name fcs /RAM/
|
|
84 fcb edition
|
|
85
|
|
86 start equ * the usual jump table for drivers
|
|
87 lbra Init
|
|
88 lbra Read
|
|
89 lbra Write
|
|
90 lbra SGtat these return errors
|
|
91 lbra SGtat
|
|
92 lbra Term
|
|
93 Init equ *
|
|
94 lbsr Initchk have we been init'd?
|
|
95 bcs DoInit
|
|
96 andcc #$FE clr the carry
|
|
97 rts don't do twice
|
|
98 DoInit inc OurLink,u so it'll get relinked
|
|
99 andcc #$FE kill the carry if set
|
|
100 leax u000F,u U is mem assigned area
|
|
101 sty OurDesc,u save for later recovery
|
|
102 pshs u,x building stack image -4
|
|
103 * the stack image is:
|
|
104 * sp+2=u, usually $4D00
|
|
105 * sp =x, usually $4D0F
|
|
106 ldu #$0028 location of time packet
|
|
107 leax DD.DAT,x set x to target location
|
|
108 ifne h6309-TRUE
|
|
109 ldb #$05 number of byte to move
|
|
110 GTime lda ,u+
|
|
111 sta ,x+
|
|
112 decb
|
|
113 bne GTime
|
|
114 endc
|
|
115 ifeq h6309-TRUE
|
|
116 ldw #$0005 we want to move 5 bytes
|
|
117 tfm u+,x+ do it
|
|
118 endc
|
|
119 ldu 2,s
|
|
120 ldx ,s
|
|
121 ldb #$01
|
|
122 stb u0006,u
|
|
123 ldx <D.Proc <$50 current process ptr
|
|
124 ldd P$User,x $08,x
|
|
125 ldx ,s get x back
|
|
126 * building a dummy sector zero's first $33 bytes
|
|
127 * which is all assembled starting at offset $0F
|
|
128 * of our initial scratchpad assignment
|
|
129 std $0B,x DD.OWNer of dummy sector zero
|
|
130 ldd #$0001
|
|
131 std $06,x DD.BIT sectors per cluster
|
|
132 lda $0D,y DD.ATT disk attributes
|
|
133 sta $0D,x
|
|
134 ldd <$1B,y IT.SCT
|
|
135 std $01,x put totsecs in DD.TOT+1
|
|
136
|
|
137 * this could be simplicated to straight 6809 code
|
|
138 ifeq h6309-TRUE
|
|
139
|
|
140 lsrd /2 but this is one cycle quicker at 3
|
|
141 lsrd /4
|
|
142 lsrd /8 8 sectors per byte
|
|
143
|
|
144 else
|
|
145
|
|
146 lsra where this is 2 per 8 bit register
|
|
147 rorb or 4 cycles for full 16 bit shift
|
|
148 lsra
|
|
149 rorb
|
|
150 lsra
|
|
151 rorb
|
|
152
|
|
153 endc
|
|
154 std RD.MAP,x s/b at $400D-E
|
|
155 subd #$0001 it grabs extra page otherwise
|
|
156 std $04,x DD.MAP (size) addr $13&14
|
|
157 ****************************************************
|
|
158 * set the location of the root FD.SCT intelligently!
|
|
159 * this is where the devpack version failed miserably,
|
|
160 * it was fixed at $0002, whole thing dead at 512k & up
|
|
161 * furinstance, with sct=1300, d=$0260 right here,
|
|
162 * therefore the FAT occupies 3 full sectors starting
|
|
163 * at sector $01
|
|
164 tfr a,b
|
|
165 incb to next page so it skips sector zero
|
|
166 incb and point to sector AFTER the FAT
|
|
167 clra simplicating it
|
|
168 std $09,x DD.DIR+1 fd location!
|
|
169 * save a copy to locate the root FD
|
|
170 stb FDlocat,x save copy for FD loc
|
|
171 * save a copy to locate the root dir
|
|
172 incb to next sector
|
|
173 stb DIRloca,x s/b @ $400B-C
|
|
174 *****************************************
|
|
175 * now lets go get enough memory to build the FAT
|
|
176 lda RD.MAP,x get msb, maybe $00
|
|
177 * if over $800 sectors, regs.a won't be zero!
|
|
178 inca round up increment to cover all
|
|
179 clrb make even page boundary
|
|
180 os9 F$SRqMem
|
|
181 lbcs L0178
|
|
182 ldx 2,s get U back
|
|
183 std MP.SIZ,x and save it
|
|
184 stu FatScra,x save FAT loc
|
|
185 ldx ,s and get x back
|
|
186 pshs u U is new mem area start -6
|
|
187 * the stack image is:
|
|
188 * sp+4=u, usually $4D00
|
|
189 * sp+2=x, usually $4D0F
|
|
190 * sp = usually $4000
|
|
191 ldu $04,s get orig $4D00 u back
|
|
192 * How many 8k blocks of mem do we need?
|
|
193 ldd RD.MAP,x already been /8
|
|
194 addd #$0003 we'll shift out, but need d2 carry
|
|
195 ifeq h6309-TRUE
|
|
196 lsrd /16
|
|
197 lsrd /32 but its 5 cycles faster!
|
|
198 else
|
|
199 lsra
|
|
200 rorb /16
|
|
201 lsra
|
|
202 rorb /32
|
|
203 endc
|
|
204
|
|
205 * D is now how many blocks we need
|
|
206 std <u0036,u 8k blocks ram needed
|
|
207 leax >u00C0,u if <$20 blocks we
|
|
208 cmpd #$0020 allow 512k in this map
|
|
209 bls L008D if go, fits this page
|
|
210 * else table of blocks won't fit from $C0-$FF,
|
|
211 * ask for another (d*2) pages
|
|
212
|
|
213 ifeq h6309-TRUE
|
|
214 asld else ask for more memory
|
|
215 else
|
|
216 lslb
|
|
217 rola
|
|
218 endc
|
|
219 os9 F$SRqMem get new U
|
|
220 lbcs L017C no more avail!
|
|
221 * we'll use this instead of $xxC0
|
|
222 * the stack image is:
|
|
223 * sp+4=u, usually $4D00
|
|
224 * sp+2=x, usually $4D0F
|
|
225 * sp = usually $4000
|
|
226 * save for later release
|
|
227 leax ,u ok ,set x to new mem ptr
|
|
228 ldu $04,s and get old u back
|
|
229 L008D equ *
|
|
230 stx <u0038,u $4EC0 for small disk
|
|
231
|
|
232 ifeq h6309-TRUE
|
|
233 ldw <u0036,u number of blocks req
|
|
234 else
|
|
235 ldy <u0036,u
|
|
236 endc
|
|
237
|
|
238 * Where did we start?
|
|
239 L0094 ldb #$01 ask for one 8K block
|
|
240 os9 F$AllRAM os9 manual doesn't say but
|
|
241 lbcs L017C returns B=# of blk allocated
|
|
242 std ,x++ make list of blocks
|
|
243
|
|
244 ifeq h6309-TRUE
|
|
245 decw that we own for later release
|
|
246 else
|
|
247 leay -1,y
|
|
248 endc
|
|
249
|
|
250 bne L0094
|
|
251
|
|
252 ifne h6309-TRUE
|
|
253 ldy <OurDesc,u we destroyed our descriptor pointer
|
|
254 endc
|
|
255
|
|
256 leax <u0040,u orig U here
|
|
257 ldd [u0038,u] addr of # of blocks we own
|
|
258 std <$40,x save at 4E80-81
|
|
259 os9 F$AllTsk
|
|
260 * this reserves a task #, then sets hardware
|
|
261 * and DAT ram to this processes addr info
|
|
262 lbcs L017C
|
|
263 lda <D.SysTsk from dp reference
|
|
264 ldb $06,x x our task number!
|
|
265 * now we can move the dummy sector zero
|
|
266 * to the first sector
|
|
267 * the stack image now is:
|
|
268 * sp+4=u, usually $4D00
|
|
269 * sp+2=x, usually $4D0F
|
|
270 * sp = usually $4000
|
|
271 ldx $02,s get source ptr
|
|
272 ldy #$001F byte count
|
|
273 pshs u save this puppy, simplicates
|
|
274 * the stack image is:
|
|
275 * sp+6=u, usually $4D00
|
|
276 * sp+4=x, usually $4D0F
|
|
277 * sp+2= usually $4000
|
|
278 * sp = our current U, $4D00?
|
|
279 ldu #$0000 destination ptr
|
|
280 os9 F$Move our dummy sector 0
|
|
281 leax >L018A,pcr devices volume name
|
|
282 leau ,y
|
|
283 ldy #$000E length of name string etc
|
|
284 * write 10 zeros for DD.BT-DD.NAM & the name section
|
|
285 os9 F$Move and move that into sector zero
|
|
286 puls u get our reference back
|
|
287 * now lets make RBF a bit happier by copying
|
|
288 * the opts section of the descriptor into
|
|
289 * sector zero too.
|
|
290 * the stack image is:
|
|
291 * sp+4=u, usually $4D00
|
|
292 * sp+2=x, usually $4D0F
|
|
293 * sp+0= usually $4000
|
|
294 ldx OurDesc,u
|
|
295 leax $12,x point to opts in desc
|
|
296 ldu #$003F point to start of opts in sector 0
|
|
297 ldy #$000F
|
|
298 os9 F$Move
|
|
299 ldu 4,s
|
|
300 * That moved enough info into what RBF thinks is sector
|
|
301 * zero of this device to tell RBF what it is & how big,
|
|
302 * where root dir is located etc.
|
|
303 FatLoop equ *
|
|
304 * Now lets move the FAT into ramdisk space
|
|
305 * the stack image is:
|
|
306 * sp+4=u, usually $4D00
|
|
307 * sp+2=x, usually $4D0F
|
|
308 * sp = usually $4000
|
|
309 ldx $02,s test valid
|
|
310 ldd RD.MAP,x saved bitmap siz
|
|
311 * using size of bitmap for fat, save it in w
|
|
312
|
|
313 ifeq h6309-TRUE
|
|
314 tfr d,w there is a method
|
|
315 else
|
|
316 std <u0002,u
|
|
317 endc
|
|
318
|
|
319 * now add enough for even page boundary
|
|
320 inca
|
|
321 clrb now D is overall size
|
|
322 ldx ,s bitmap addr
|
|
323 * now we know how big it is
|
|
324 leay d,x
|
|
325 pshs y save ending addr (page)
|
|
326 * the stack image is:
|
|
327 * sp+6=u, usually $4D00
|
|
328 * sp+4=x, usually $4D0F
|
|
329 * sp+2= usually $4000
|
|
330 * sp = top of fat, $4100
|
|
331 L00DC equ *
|
|
332
|
|
333 ifeq h6309-TRUE
|
|
334 leay w,x set y=where active fat ends
|
|
335 else
|
|
336 pshs d
|
|
337 ldd <u0002,u
|
|
338 leay d,x
|
|
339 puls d
|
|
340 endc
|
|
341
|
|
342 pshs y stack the end of active
|
|
343 * the stack image is:
|
|
344 * sp+8=u, usually $4D00
|
|
345 * sp+6=x, usually $4D0F
|
|
346 * sp+4= usually $4000
|
|
347 * sp+2= top of fat, $4100
|
|
348 * sp = end of active fat, $403D?
|
|
349 ldx $04,s s/b the fat workspace base addr
|
|
350 ldb #$FF allocate 1st 8 'sectors'
|
|
351 L00E2 stb ,x+
|
|
352 stb ,x+ make basic alloc $10 sectors
|
|
353 L00E5 clr ,x+ and mark the rest clear
|
|
354 cmpx ,s to end of active
|
|
355 bcs L00E5 (was bcs)till the end of the fat
|
|
356 * should show the end of the fat in x
|
|
357 L00EA stb ,x+ then mark full
|
|
358 cmpx $02,s for remainder of last page
|
|
359 bcs L00EA (wonder if this s/b bls too!)
|
|
360 * the stack image is:
|
|
361 * sp+8=u, usually $4D00
|
|
362 * sp+6=x, usually $4D0F
|
|
363 * sp+4= usually $4000
|
|
364 * sp+2= top of fat, $4100
|
|
365 * sp = end of active fat, $403D?
|
|
366 ldu $08,s get our base page back
|
|
367 lda <D.SysTsk u00D0 note dp, is D.SysTsk
|
|
368 ldb <u0046,u assigned P$Task
|
|
369 pshs d save it for following move
|
|
370 * the stack image is:
|
|
371 * sp+A=u, usually $4D00
|
|
372 * sp+8=x, usually $4D0F
|
|
373 * sp+6= usually $4000
|
|
374 * sp+4= top of fat, $4100
|
|
375 * sp+2= end of active fat, $403D?
|
|
376 * sp = our task numbers
|
|
377 ldd $04,s get end of fat
|
|
378 subd $06,s should leave fatsize in d
|
|
379 tfr d,y size to y
|
|
380 puls d restore our tsknums
|
|
381 * the stack image is:
|
|
382 * sp+8=u, usually $4D00
|
|
383 * sp+6=x, usually $4D0F
|
|
384 * sp+4= usually $4000
|
|
385 * sp+2= top of fat, $4100
|
|
386 * sp = end of active fat, $403D?
|
|
387 ldu #$0100 start of FAT
|
|
388 ldx $04,s
|
|
389 os9 F$Move
|
|
390 * we're done with the fat, its moved into the space
|
|
391 * for the device. Now make a dummy FD in the same
|
|
392 * memory area
|
|
393 leas $02,s don't need end of active fat anymore
|
|
394 MkRoot1 clr ,x+
|
|
395 cmpx ,s clearing the mem,done w/fat
|
|
396 bcs MkRoot1
|
|
397 * the stack image is:
|
|
398 * sp+6=u, usually $4D00
|
|
399 * sp+4=x, usually $4D0F
|
|
400 * sp+2= usually $4000
|
|
401 * sp+0= top of fat, $4100
|
|
402 ldx $02,s
|
|
403 ldu $04,s
|
|
404 * Ok, now lets make an FD sector for the root dir
|
|
405 FDmaker equ *
|
|
406 lda u000D,u DD.ATT
|
|
407 sta ,x
|
|
408 ldd u000B,u
|
|
409 std $01,x
|
|
410 ldb #$01 this is the link count
|
|
411 stb $08,x
|
|
412 ldd #$0040
|
|
413 std $0B,x
|
|
414 ldb DIRloca,u
|
|
415 stb <$12,x
|
|
416 ldd #$0010
|
|
417 * Now a bit more intelligence applied
|
|
418 subb DIRloca,u
|
|
419 std <$13,x
|
|
420 lda <D.SysTsk u00D0
|
|
421 * the stack image is:
|
|
422 * sp+6=u, usually $4D00
|
|
423 * sp+4=x, usually $4D0F
|
|
424 * sp+2= usually $4000
|
|
425 * sp+0= top of fat, $4100
|
|
426 ldu $06,s
|
|
427 ldb <u0046,u
|
|
428 pshs x
|
|
429 * the stack image is:
|
|
430 * sp+8=u, usually $4D00
|
|
431 * sp+6=x, usually $4D0F
|
|
432 * sp+4= usually $4000
|
|
433 * sp+2= top of fat, $4100
|
|
434 * sp = saved bottom of work area
|
|
435 ldx $06,s
|
|
436 * now set u to actual offset of FDlocation
|
|
437
|
|
438 ifeq h6309-TRUE
|
|
439 lde FDlocat,x this is why we saved it
|
|
440 clrf
|
|
441 tfr w,u neat huh?
|
|
442 else
|
|
443 pshs d
|
|
444 lda FDLocat,x
|
|
445 clrb
|
|
446 tfr d,u
|
|
447 puls d
|
|
448 endc
|
|
449
|
|
450 puls x
|
|
451 * the stack image is:
|
|
452 * sp+6=u, usually $4D00
|
|
453 * sp+4=x, usually $4D0F
|
|
454 * sp+2= usually $4000
|
|
455 * sp+0= top of fat, $4100
|
|
456 ldy #$0100
|
|
457 os9 F$Move
|
|
458 leay <$16,x why only $16, the dir is $40!
|
|
459 pshs y
|
|
460 * the stack image is:
|
|
461 * sp+8=u, usually $4D00
|
|
462 * sp+6=x, usually $4D0F
|
|
463 * sp+4= usually $4000
|
|
464 * sp+2= top of fat, $4100
|
|
465 * sp = saved top of work area
|
|
466 L0144 clr ,x+
|
|
467 cmpx ,s
|
|
468 bcs L0144
|
|
469 leas $02,s get rid of that
|
|
470 * the stack image is:
|
|
471 * sp+6=u, usually $4D00
|
|
472 * sp+4=x, usually $4D0F
|
|
473 * sp+2= usually $4000
|
|
474 * sp+0= top of fat, $4100
|
|
475 ldx $02,s s/b right
|
|
476 leay $40,x
|
|
477 pshs y
|
|
478 DClr clr ,x+
|
|
479 cmpx ,s
|
|
480 bcs DClr
|
|
481 leas $02,s
|
|
482 ldx $02,s get it back again
|
|
483 ldd #$2EAE
|
|
484 std ,x
|
|
485 stb <$20,x
|
|
486 * again, I've gotta apply some smarts to locating it
|
|
487 ldx $04,s
|
|
488 ldb FDlocat,x
|
|
489 clra
|
|
490 ldx $02,s
|
|
491 std <$1E,x
|
|
492 std <$3E,x
|
|
493 lda <D.SysTsk u00D0
|
|
494 * the stack image is:
|
|
495 * sp+6=u, usually $4D00
|
|
496 * sp+4=x, usually $4D0F
|
|
497 * sp+2= usually $4000
|
|
498 * sp+0= top of fat, $4100
|
|
499 ldu $06,s
|
|
500 ldb <u0046,u
|
|
501 ldy #$0040
|
|
502 ldx $04,s
|
|
503
|
|
504 ifeq h6309-TRUE
|
|
505 lde DIRloca,x
|
|
506 clrf
|
|
507 tfr w,u
|
|
508 else
|
|
509 pshs d
|
|
510 lda DIRloca,x
|
|
511 clrb
|
|
512 tfr d,u
|
|
513 puls d
|
|
514 endc
|
|
515
|
|
516 ldx $02,s
|
|
517 os9 F$Move
|
|
518 ldx $04,s
|
|
519 lda RD.MAP,x
|
|
520 inca
|
|
521 clrb
|
|
522 leas $02,s
|
|
523 * the stack image is:
|
|
524 * sp+4=u, usually $4D00
|
|
525 * sp+2=x, usually $4D0F
|
|
526 * sp+0= usually $4000
|
|
527 puls u
|
|
528 * the stack image is:
|
|
529 * sp+2=u, usually $4D00
|
|
530 * sp+0=x, usually $4D0F
|
|
531 os9 F$SRtMem give back FatScra
|
|
532 L0178 leas $02,s skip the x offset
|
|
533 puls u get orig assignment back!
|
|
534
|
|
535 ifeq h6309-TRUE
|
|
536 ldw <L018A,pcr
|
|
537 stw Initstt,u crash time?
|
|
538 else
|
|
539 pshs d
|
|
540 ldd <L018A,pcr
|
|
541 std Initstt,u
|
|
542 puls d
|
|
543 endc
|
|
544
|
|
545 clrb
|
|
546 rts puls pc,u U allready pulled, use rts
|
|
547
|
|
548 L017C leas $04,s
|
|
549 puls pc,u
|
|
550 L018A fcs /Gene's RamDisk/
|
|
551 Initchk equ *
|
|
552 ifeq h6309-TRUE
|
|
553 ldw Initstt,u <L018A,pcr
|
|
554 cmpw <L018A,pcr Initstt,u
|
|
555 beq InitOk
|
|
556 else
|
|
557 pshs d
|
|
558 ldd Initstt,u
|
|
559 cmpd <L018A,pcr
|
|
560 puls d
|
|
561 beq InitOk
|
|
562 endc
|
|
563 comb
|
|
564 ldb E$NotRdy else report error
|
|
565 InitOk equ * relocated to give exit report
|
|
566 rts
|
|
567
|
|
568 Read equ *
|
|
569 * First, have we been assigned any memory?
|
|
570 bsr Initchk
|
|
571 * Now, if carry is clear, we have some memory, go
|
|
572 bcc ReadOk
|
|
573 rts return the error condition
|
|
574
|
|
575 ReadOk tst OurLink,u
|
|
576 beq ReadOk1
|
|
577 bsr Linkus bsr ChkLink
|
|
578 ReadOk1 pshs u
|
|
579 bsr L01C2
|
|
580 bcs L01C0
|
|
581 tfr d,x
|
|
582 lda <u0046,u
|
|
583 ldb <D.SysTsk u00D0
|
|
584 ldu $08,y
|
|
585 bra L01B9
|
|
586 ************ A seperate linker
|
|
587 Linkus pshs x
|
|
588 ldx PD.DVT,y
|
|
589 inc V$USRS,x
|
|
590 * ldy OurDesc,u
|
|
591 * ldd M$Name,y
|
|
592 * leax d,y point to device name
|
|
593 * ldd <D.Proc this is temp
|
|
594 * pshs d save it as no time slicing
|
|
595 * ldd <D.SysPrc takes place while
|
|
596 * std <D.Proc this is in effect!
|
|
597 * clra any type/lang
|
|
598 * os9 I$Attach
|
|
599 * puls d
|
|
600 * std <D.Proc
|
|
601 * bcc LinkusOK
|
|
602 * os9 F$Exit take error with us
|
|
603 LinkusOK puls x and restore our entry values
|
|
604 clr OurLink,u so we don't re-attach us again
|
|
605 rts
|
|
606
|
|
607 Write equ *
|
|
608 bsr Initchk
|
|
609 bcc WriteOk
|
|
610 rts
|
|
611 WriteOk tst OurLink,u has it been done?
|
|
612 beq WriteOk1
|
|
613 bsr Linkus
|
|
614 WriteOk1 pshs u
|
|
615 bsr L01C2
|
|
616 bcs L01C0
|
|
617 pshs b,a
|
|
618 lda <D.SysTsk
|
|
619 ldb <u0046,u
|
|
620 ldx $08,y
|
|
621 puls u
|
|
622 L01B9 ldy #$0100
|
|
623 os9 F$Move
|
|
624 L01C0 puls pc,u
|
|
625 L01C2 pshs x
|
|
626 tstb
|
|
627 bne L01F1
|
|
628 L01C7 cmpx <u0010,u
|
|
629 bcc L01F1
|
|
630 tfr x,d
|
|
631
|
|
632 ifeq h6309-TRUE
|
|
633 lsrd /2
|
|
634 lsrd /4
|
|
635 lsrd /8
|
|
636 lsrd /16
|
|
637 else
|
|
638 lsra
|
|
639 rorb
|
|
640 lsra
|
|
641 rorb
|
|
642 lsra
|
|
643 rorb
|
|
644 lsra
|
|
645 rorb
|
|
646 endc
|
|
647
|
|
648 andb #$FE
|
|
649 L01D8 ldx <u0038,u
|
|
650 beq L01F5
|
|
651 ldd d,x
|
|
652 beq L01F5
|
|
653 leax <u0040,u
|
|
654 std <$40,x
|
|
655 os9 F$SetTsk
|
|
656 lda $01,s
|
|
657 anda #$1F
|
|
658 clrb
|
|
659 puls pc,x
|
|
660 L01F1 ldb #$F1 load the error code
|
|
661 bra L01F7
|
|
662 L01F5 ldb #$F4 load the error code
|
|
663 L01F7 orcc #$01 set the carry
|
|
664 puls pc,x and go home with the error
|
|
665 SGtat comb
|
|
666 ldb #$D0 #E$IllMode
|
|
667 rts
|
|
668 Term equ *
|
|
669 pshs u
|
|
670 ifeq h6309-TRUE
|
|
671 ldw <u0036,u
|
|
672 else
|
|
673 ldy <u0036,u
|
|
674 endc
|
|
675
|
|
676 ldu <u0038,u
|
|
677 beq L022A
|
1347
|
678 L020A ldb #$01 is now the same as F$AllRAM loop in
|
0
|
679 ldx ,u++ the Init routine
|
|
680 beq L0213 this fixed some loose
|
|
681 os9 F$DelRAM ends mmap showed
|
|
682 L0213 equ *
|
|
683
|
|
684 ifeq h6309-TRUE
|
|
685 decw was leay -$01,y
|
|
686 else
|
|
687 leay -1,y
|
|
688 endc
|
|
689
|
|
690 bne L020A
|
|
691 ldu ,s
|
|
692 ldd <u0036,u
|
|
693 cmpd #$0020
|
|
694 bls L022A
|
|
695
|
|
696 ifeq h6309-TRUE
|
|
697 lsld
|
|
698 else
|
|
699 lslb
|
|
700 rora
|
|
701 endc
|
|
702
|
|
703 ldu <u0038,u
|
|
704 os9 F$SRtMem
|
|
705 L022A clra to remove, clrb here
|
|
706 clrb
|
|
707 puls u
|
|
708 std Initstt,u and "comment" us out
|
|
709 rts
|
|
710
|
|
711 emod
|
|
712 eom equ *
|
|
713 end
|
|
714
|
|
715 * a parking place for the snoop code
|
|
716 * pshs cc
|
|
717 * os9 F$RegDmp lets take a look
|
|
718 * puls cc
|
|
719 * end of the snoop code, 4 %&$# lines!
|
|
720
|