Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/rfm.asm @ 3130:e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Tidy up white-space and indentation.
Expand documentation to show C flag is important on return
from HWRead.
Expand documentation to show how/why/when filler is needed at
end of file.
Delete dead code in some places. No functional changes.
author | Neal Crook <foofoobedoo@gmail.com> |
---|---|
date | Sun, 04 Dec 2016 21:01:42 +0000 |
parents | fbf145e9d668 |
children |
rev | line source |
---|---|
2435 | 1 ******************************************************************** |
2 * RFM - Remote File Manager | |
3 * | |
2461 | 4 * $Id$ |
2435 | 5 * |
2461 | 6 * Edt/Rev YYYY/MM/DD Modified by |
7 * Comment | |
8 * ------------------------------------------------------------------ | |
9 * 1 2010/02/20 Aaron Wolfe | |
10 * initial version - just sends ops to server | |
2435 | 11 |
2445 | 12 nam RFM |
13 ttl Remote File Manager | |
2435 | 14 |
2445 | 15 ifp1 |
16 use defsfile | |
2658
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
17 use rfm.d |
2624 | 18 use drivewire.d |
2445 | 19 endc |
2435 | 20 |
2445 | 21 tylg set FlMgr+Objct |
22 atrv set ReEnt+rev | |
23 rev set 0 | |
24 edition equ 1 | |
2435 | 25 |
2445 | 26 mod eom,RFMName,tylg,atrv,RFMEnt,size |
2442 | 27 |
2445 | 28 size equ . |
29 | |
30 | |
31 RFMName fcs /RFM/ | |
32 fcb edition | |
2435 | 33 |
34 | |
35 ****************************** | |
36 * | |
37 * file manager entry point | |
38 * | |
2445 | 39 RFMEnt lbra create Create path |
40 lbra open Open path | |
41 lbra makdir Makdir | |
42 lbra chgdir Chgdir | |
43 lbra delete Delete | |
44 lbra seek Seek | |
45 lbra read Read character | |
46 lbra write Write character | |
47 lbra readln ReadLn | |
48 lbra writln WriteLn | |
49 lbra getstt Get Status | |
50 lbra setstt Set Status | |
51 lbra close Close path | |
52 | |
2461 | 53 |
54 ****************************** | |
55 * | |
56 * Create - creates a file on the remote device | |
57 * | |
58 * Entry: Y = Path descriptor pointer | |
59 * U = Callers register stack pointer | |
60 * | |
2445 | 61 create ldb #DW.create |
62 bra create1 | |
63 | |
64 | |
2461 | 65 ****************************** |
66 * | |
67 * Open - opens a file on the remote device | |
68 * | |
69 * Entry: Y = Path descriptor pointer | |
70 * U = Callers register stack pointer | |
71 * | |
2462 | 72 * Exit: CC.Carry = 0 (no error), 1 (error) |
73 * B = error code (if CC.Carry == 1) | |
74 * | |
2445 | 75 open ldb #DW.open |
2447 | 76 create1 |
2453 | 77 ldx PD.DEV,y ; get ptr to our device memory |
78 ldx V$STAT,x ; get ptr to our static storage | |
2450 | 79 pshs x,y,u ; save all on stack |
80 stb V.DWCMD,x | |
81 | |
2445 | 82 * TODO lets not create multiple buffers when multiple open/create on same path |
83 * get system mem | |
84 ldd #256 | |
85 os9 F$SRqMem ; ask for D bytes (# bytes server said is coming) | |
2450 | 86 lbcs open2 |
2445 | 87 stu V.BUF,x |
88 | |
2450 | 89 * use PrsNam to validate pathlist and count length |
90 ldu 4,s ; get pointer to caller's registers | |
91 ldy R$X,u | |
92 sty V.PATHNAME,x | |
93 tfr y,x | |
94 prsloop os9 F$PrsNam | |
95 bcs open2 | |
96 tfr y,x | |
97 anda #$7F | |
98 cmpa #PENTIR | |
99 bne chkdelim | |
100 ldb #E$BPNam | |
101 bra openerr | |
102 chkdelim cmpa #PDELIM | |
103 beq prsloop | |
104 * at this point X points to the character AFTER the last character in the name | |
105 * update callers R$X | |
106 ldu 4,s ; get caller's registers | |
107 stx R$X,u | |
108 | |
109 * compute the length of the pathname and save it | |
110 tfr x,d | |
111 ldx ,s ; get the device memory pointer | |
112 subd V.PATHNAME,x | |
113 std V.PATHNAMELEN,x ; save the length | |
114 | |
2541 | 115 * put the mode byte on the stack |
116 pshs cc | |
117 lda R$A,u | |
118 pshs a | |
119 | |
2450 | 120 * put command byte & path # on stack |
121 lda V.DWCMD,x | |
2541 | 122 ldy 4,s |
2447 | 123 ldb PD.PD,y |
2454 | 124 pshs d ; p# PD.PD Regs |
2447 | 125 |
126 * put rfm op and DW op on stack | |
127 lda #OP_VFM | |
2454 | 128 pshs a ; DWOP RFMOP p# PD.PD Regs |
2447 | 129 |
2445 | 130 leax ,s ; point X to stack |
2541 | 131 ldy #4 ; 3 bytes to send |
2445 | 132 |
133 ifgt Level-1 | |
134 ldu <D.DWSubAddr | |
135 else | |
136 ldu >D.DWSubAddr | |
137 endc | |
138 | |
2447 | 139 orcc #IntMasks |
2445 | 140 jsr 6,u |
2541 | 141 leas 4,s ;clean stack PD.PD Regs |
2445 | 142 |
2462 | 143 ifgt Level-1 |
2445 | 144 * now send path string |
2450 | 145 * move from caller to our mem |
2444 | 146 |
2450 | 147 ldx <D.Proc get calling proc desc |
148 lda P$Task,x ; A = callers task # (source) | |
2445 | 149 |
2450 | 150 ldb <D.SysTsk ; B = system task # (dest) |
2462 | 151 endc |
152 | |
2450 | 153 ldx 1,s ; get device mem ptr |
2467 | 154 ifgt Level-1 |
2450 | 155 ldu V.BUF,x ; get destination pointer in U |
2467 | 156 endc |
2450 | 157 ldy V.PATHNAMELEN,x ; get count in Y |
158 ldx V.PATHNAME,x ; get source in X | |
2445 | 159 |
2462 | 160 ifgt Level-1 |
2450 | 161 * F$Move the bytes (seems to work) |
162 os9 F$Move | |
163 bcs moverr | |
2462 | 164 endc |
165 | |
2450 | 166 * Add carriage return |
2467 | 167 ifgt Level-1 |
2450 | 168 tfr u,x |
2467 | 169 else |
170 tfr x,u | |
171 endc | |
2450 | 172 tfr y,d |
173 leau d,u | |
174 lda #C$CR | |
175 sta ,u | |
176 leay 1,y | |
2436 | 177 |
2445 | 178 * send to server |
2450 | 179 ifgt Level-1 |
180 ldu <D.DWSubAddr | |
181 else | |
182 ldu >D.DWSubAddr | |
183 endc | |
2445 | 184 jsr 6,u |
185 | |
186 * read response from server -> B | |
2450 | 187 clr ,-s |
2445 | 188 leax ,s |
189 ldy #1 | |
190 jsr 3,u | |
191 | |
192 * pull server's response into B | |
2454 | 193 puls b ; PD.PD Regs |
2450 | 194 moverr puls cc |
2445 | 195 tstb |
196 beq open2 | |
197 | |
2450 | 198 openerr coma ; set error |
2452 | 199 open2 puls x,y,u,pc |
2445 | 200 |
2462 | 201 |
202 ****************************** | |
203 * | |
204 * MakDir - creates a directory on the remote device | |
205 * | |
206 * Entry: Y = Path descriptor pointer | |
207 * U = Callers register stack pointer | |
208 * | |
209 * Exit: CC.Carry = 0 (no error), 1 (error) | |
210 * B = error code (if CC.Carry == 1) | |
211 * | |
2445 | 212 makdir lda #DW.makdir |
213 lbra sendit | |
2462 | 214 |
215 ****************************** | |
216 * | |
217 * ChgDir - changes the data/execution directory on the remote device | |
218 * | |
219 * Entry: Y = Path descriptor pointer | |
220 * U = Callers register stack pointer | |
221 * | |
222 * Exit: CC.Carry = 0 (no error), 1 (error) | |
223 * B = error code (if CC.Carry == 1) | |
224 * | |
2445 | 225 chgdir lda #DW.chgdir |
226 lbra sendit | |
2462 | 227 |
228 ****************************** | |
229 * | |
230 * Delete - delete a file on the remote device | |
231 * | |
232 * Entry: Y = Path descriptor pointer | |
233 * U = Callers register stack pointer | |
234 * | |
235 * Exit: CC.Carry = 0 (no error), 1 (error) | |
236 * B = error code (if CC.Carry == 1) | |
237 * | |
2445 | 238 delete lda #DW.delete |
239 lbra sendit | |
2460 | 240 |
241 | |
2461 | 242 ****************************** |
243 * | |
244 * Seek - seeks into a file on the remote device | |
245 * | |
246 * Entry: Y = Path descriptor pointer | |
247 * U = Callers register stack pointer | |
248 * | |
2462 | 249 * Exit: CC.Carry = 0 (no error), 1 (error) |
250 * B = error code (if CC.Carry == 1) | |
251 * | |
2460 | 252 * seek = send dwop, rfmop, path, caller's X + U |
2462 | 253 seek pshs y,u |
2460 | 254 |
255 ldx R$U,u | |
256 pshs x | |
257 ldx R$X,u | |
258 pshs x | |
259 lda PD.PD,y | |
260 pshs a | |
2462 | 261 ldd #OP_VFM*256+DW.seek |
2460 | 262 pshs d |
263 | |
2462 | 264 leax ,s ; point X to stack |
265 ldy #7 ; 7 bytes to send | |
2460 | 266 |
267 * set U to dwsub | |
2462 | 268 ifgt Level-1 |
269 ldu <D.DWSubAddr | |
270 else | |
271 ldu >D.DWSubAddr | |
272 endc | |
2460 | 273 |
274 * send dw op, rfm op, path # | |
2462 | 275 jsr 6,u |
2545 | 276 leas 6,s ;clean stack - PD.PD Regs |
277 | |
278 * read response from server | |
279 leax ,s | |
280 ldy #1 | |
281 jsr 3,u | |
282 | |
283 puls b | |
284 tstb | |
285 beq ok@ | |
286 coma | |
287 bra notok@ | |
288 ok@ clrb | |
289 notok@ puls y,u,pc | |
2460 | 290 |
2436 | 291 |
2461 | 292 ****************************** |
293 * | |
294 * Read - reads data from a file on the remote device | |
295 * | |
296 * Entry: Y = Path descriptor pointer | |
297 * U = Callers register stack pointer | |
298 * | |
2462 | 299 * Exit: CC.Carry = 0 (no error), 1 (error) |
300 * B = error code (if CC.Carry == 1) | |
301 * | |
302 read ldb #DW.read | |
303 bra read1 ; join readln routine | |
2445 | 304 |
305 | |
306 | |
2461 | 307 ****************************** |
308 * | |
309 * Write - writes data to a file on the remote device | |
310 * | |
311 * Entry: Y = Path descriptor pointer | |
312 * U = Callers register stack pointer | |
313 * | |
2462 | 314 * Exit: CC.Carry = 0 (no error), 1 (error) |
315 * B = error code (if CC.Carry == 1) | |
316 * | |
2464 | 317 write ldb #DW.write |
318 lbra write1 | |
2445 | 319 |
320 | |
321 | |
2461 | 322 ****************************** |
323 * | |
324 * ReadLn - reads a line of data from a file on the remote device | |
325 * | |
326 * Entry: Y = Path descriptor pointer | |
327 * U = Callers register stack pointer | |
328 * | |
2462 | 329 * Exit: CC.Carry = 0 (no error), 1 (error) |
330 * B = error code (if CC.Carry == 1) | |
331 * | |
2445 | 332 readln ldb #DW.readln |
2447 | 333 read1 ldx PD.DEV,y ; to our static storage |
2454 | 334 ldx V$STAT,x |
2447 | 335 pshs x,y,u |
2445 | 336 |
337 * put path # on stack | |
2447 | 338 lda PD.PD,y |
339 pshs cc | |
2454 | 340 pshs a ; p# PD.PD Regs |
2445 | 341 |
342 * put rfm op and DW op on stack | |
343 | |
344 lda #OP_VFM | |
2454 | 345 pshs d ; DWOP RFMOP p# PD.PD Regs |
2445 | 346 |
347 leax ,s ; point X to stack | |
348 ldy #3 ; 3 bytes to send | |
349 | |
350 * set U to dwsub | |
351 ifgt Level-1 | |
352 ldu <D.DWSubAddr | |
353 else | |
354 ldu >D.DWSubAddr | |
355 endc | |
356 | |
357 * send dw op, rfm op, path # | |
2447 | 358 orcc #IntMasks |
2445 | 359 jsr 6,u |
2454 | 360 leas 3,s ;clean stack - PD.PD Regs |
2445 | 361 |
362 * put caller's Y on stack (maximum allowed bytes) | |
2447 | 363 ldx 5,s |
2445 | 364 ldx R$Y,x |
365 pshs x | |
366 | |
367 * send 2 bytes from stack | |
368 leax ,s | |
369 ldy #2 | |
370 jsr 6,u | |
371 | |
372 leas 1,s ; leave 1 byte for server response in next section | |
373 | |
374 * read # bytes coming (0 = eof) from server | |
375 leax ,s | |
376 ldy #1 | |
377 jsr 3,u | |
378 | |
379 * store size | |
380 clra | |
2454 | 381 puls b ;PD.PD Regs |
2445 | 382 |
383 | |
384 * check for 0 | |
2447 | 385 tstb |
2445 | 386 beq readln1 ; 0 bytes = EOF |
387 | |
388 * read the data from server if > 0 | |
2454 | 389 go_on pshs d ;xfersz PD.PD Regs |
2445 | 390 |
391 * load data from server into mem block | |
2467 | 392 ifgt Level-1 |
2455 | 393 ldx 3,s ; V$STAT |
2445 | 394 ldx V.BUF,x |
2467 | 395 else |
396 ldx 7,s ; caller regs | |
397 std R$Y,x | |
398 ldx R$X,x | |
399 endc | |
2445 | 400 ldy ,s ;xfersz |
401 jsr 3,u | |
402 | |
403 * F$Move | |
404 * a = my task # | |
405 * b = caller's task # | |
406 * X = source ptr | |
407 * Y = byte count | |
408 * U = dest ptr | |
409 | |
410 * move from our mem to caller | |
411 | |
2454 | 412 puls y ;Y = byte count (already set?) - PD.PD Regs |
2447 | 413 puls cc |
2445 | 414 |
2462 | 415 ifgt Level-1 |
2445 | 416 ldx 4,s |
417 ldu R$X,x ; U = caller's X = dest ptr | |
2450 | 418 sty R$Y,x |
419 | |
2445 | 420 lda <D.SysTsk ; A = system task # |
421 | |
422 ldx <D.Proc get calling proc desc | |
423 ldb P$Task,x ; B = callers task # | |
424 | |
2467 | 425 ldx ,s ; V$STAT - PD Regs |
2445 | 426 ldx V.BUF,x |
427 | |
428 * F$Move the bytes (seems to work) | |
429 os9 F$Move | |
2462 | 430 endc |
2445 | 431 * assume everything worked (not good) |
432 clrb | |
433 bra readln2 | |
434 | |
2447 | 435 readln1 |
436 puls cc | |
437 comb | |
438 ldb #E$EOF | |
2467 | 439 readln2 puls x,y,u,pc |
2436 | 440 |
2445 | 441 |
2464 | 442 |
443 | |
2461 | 444 ****************************** |
445 * | |
446 * WritLn - writes a line of data to a file on the remote device | |
447 * | |
448 * Entry: Y = Path descriptor pointer | |
449 * U = Callers register stack pointer | |
450 * | |
2462 | 451 * Exit: CC.Carry = 0 (no error), 1 (error) |
452 * B = error code (if CC.Carry == 1) | |
453 * | |
2464 | 454 writln ldb #DW.writln |
455 | |
456 write1 ldx PD.DEV,y ; to our static storage | |
457 ldx V$STAT,x | |
458 pshs x,y,u ; Vstat pd regs | |
459 | |
460 * put path # on stack | |
461 lda PD.PD,y | |
462 pshs cc ; cc vstat pd regs | |
463 pshs a ; p# cc vstat PD Regs | |
464 | |
465 * put rfm op and DW op on stack | |
466 | |
467 lda #OP_VFM | |
468 pshs d ; DWOP RFMOP p# cc vstat PD.PD Regs | |
469 | |
470 leax ,s ; point X to stack | |
471 ldy #3 ; 3 bytes to send | |
472 | |
473 * set U to dwsub | |
474 ifgt Level-1 | |
475 ldu <D.DWSubAddr | |
476 else | |
477 ldu >D.DWSubAddr | |
478 endc | |
479 | |
480 * send dw op, rfm op, path # | |
481 orcc #IntMasks | |
482 jsr 6,u | |
483 leas 3,s ;clean stack - cc vstat PD.PD Regs | |
484 | |
485 * put caller's Y on stack (maximum allowed bytes) | |
486 ldx 5,s | |
487 ldx R$Y,x | |
488 pshs x ;bytes cc vstat PD.PD Regs | |
489 | |
490 * send 2 bytes from stack | |
491 leax ,s | |
492 ldy #2 | |
493 jsr 6,u | |
494 | |
495 * move caller's data into our buf | |
2445 | 496 |
2464 | 497 * F$Move |
498 * a = my task # | |
499 * b = caller's task # | |
500 * X = source ptr | |
501 * Y = byte count | |
502 * U = dest ptr | |
503 | |
504 puls y ;Y = byte count (already set?) cc vstat PD.PD Regs | |
505 | |
506 ifgt Level-1 | |
507 | |
508 ldb <D.SysTsk ; dst B = us | |
509 | |
510 pshs u ; dwsub cc vstat PD.PD Regs | |
511 ldx 3,s | |
512 ldu V.BUF,x ; dst U = our v.buf | |
513 | |
514 ldx <D.Proc get calling proc desc | |
515 lda P$Task,x ; src A = callers task # | |
516 | |
517 ldx 7,s ; orig U | |
518 ldx R$X,x ; src = caller's X | |
519 | |
520 | |
521 * F$Move the bytes | |
522 os9 F$Move | |
523 | |
524 * send v.buf to server | |
525 | |
526 puls u ; cc vstat PD.PD Regs | |
527 ldx 1,s | |
528 ldx V.BUF,x | |
2470 | 529 else |
530 ldx 5,s | |
531 ldx R$X,x | |
532 endc | |
2464 | 533 |
534 jsr 6,u | |
535 | |
536 puls cc ; vstat PD.PD Regs | |
537 bra writln2 | |
538 * error exit? | |
539 | |
2465 | 540 writln2 puls x,y,u,pc |
2464 | 541 |
542 | |
543 | |
544 | |
545 | |
546 | |
547 | |
548 | |
2461 | 549 ****************************** |
2445 | 550 * |
2461 | 551 * GetStat - obtain status of file on the remote device |
2445 | 552 * |
2461 | 553 * Entry: Y = Path descriptor pointer |
554 * U = Callers register stack pointer | |
2445 | 555 * |
2461 | 556 * Exit: CC.Carry = 0 (no error), 1 (error) |
557 * B = error code (if CC.Carry == 1) | |
2445 | 558 * |
559 getstt | |
2463 | 560 lda PD.PD,y |
2460 | 561 lbsr sendgstt |
2445 | 562 |
563 ldb R$B,u get function code | |
564 beq GstOPT | |
565 cmpb #SS.EOF | |
566 beq GstEOF | |
567 cmpb #SS.Ready | |
568 beq GstReady | |
569 cmpb #SS.Size | |
570 beq GstSize | |
571 cmpb #SS.Pos | |
572 beq GstPos | |
573 cmpb #SS.FD | |
574 beq GstFD | |
575 cmpb #SS.FDInf | |
576 beq GstFDInf | |
2658
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
577 cmpb #SS.DirEnt |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
578 beq GstDirEnt |
2470 | 579 * comb |
580 * ldb #E$UnkSvc | |
581 clrb | |
2445 | 582 rts |
583 | |
584 * SS.OPT | |
2462 | 585 * RFM does nothing here, so we do nothing |
2445 | 586 GstOPT |
587 rts | |
588 | |
589 * SS.EOF | |
590 * Entry A = path | |
591 * B = SS.EOF | |
592 GstEOF | |
593 rts | |
594 | |
595 * SS.Ready - Check for data available on path | |
596 * Entry A = path | |
597 * B = SS.Ready | |
598 GstReady | |
599 clr R$B,u always mark no data ready | |
600 rts | |
601 | |
602 * SS.Size - Return size of file opened on path | |
603 * Entry A = path | |
604 * B = SS.SIZ | |
605 * Exit X = msw of files size | |
606 * U = lsw of files size | |
607 GstSize | |
608 rts | |
609 | |
610 * SS.Pos - Return the current position in the file | |
611 * Entry A = path | |
612 * B = SS.Pos | |
613 * Exit X = msw of pos | |
614 * U = lsw of pos | |
615 GstPOS | |
616 rts | |
617 | |
618 * SS.FD - Return file descriptor sector | |
619 * Entry: A = path | |
620 * B = SS.FD | |
621 * X = ptr to 256 byte buffer | |
622 * Y = # of bytes of FD required | |
623 | |
2463 | 624 * path # and SS.FD already sent to server, so |
625 * send Y, recv Y bytes, get them into caller at X | |
626 * Y and U here are still as at entry | |
627 GstFD | |
2466 | 628 ldx PD.DEV,y |
629 ldx V$STAT,x | |
630 pshs x,y,u | |
2463 | 631 |
632 * send caller's Y (do we really need this to be 16bit? X points to 256byte buff? | |
2466 | 633 ldx R$Y,u |
2463 | 634 pshs x |
635 leax ,s | |
636 ldy #2 | |
637 | |
638 * set U to dwsub | |
639 ifgt Level-1 | |
640 ldu <D.DWSubAddr | |
641 else | |
642 ldu >D.DWSubAddr | |
643 endc | |
644 | |
645 jsr 6,u | |
646 | |
647 * recv bytes into v.buf | |
648 puls y | |
2466 | 649 ldx ,s ; V$STAT |
2463 | 650 ldx V.BUF,x |
2467 | 651 |
652 ifgt Level-1 | |
2463 | 653 pshs x |
2467 | 654 endc |
2463 | 655 |
656 jsr 3,u | |
2467 | 657 |
658 ifgt Level-1 | |
2463 | 659 * move v.buf into caller |
660 | |
661 ldx 4,s | |
662 ldu R$X,x ; U = caller's X = dest ptr | |
663 sty R$Y,x ; do we need to set this for caller? | |
664 | |
665 lda <D.SysTsk ; A = system task # | |
666 | |
667 ldx <D.Proc get calling proc desc | |
668 ldb P$Task,x ; B = callers task # | |
669 | |
670 puls x ; V.BUF from earlier | |
2467 | 671 |
2463 | 672 * F$Move the bytes (seems to work) |
673 os9 F$Move | |
674 | |
2467 | 675 else |
676 endc | |
677 | |
2463 | 678 * assume everything worked (not good) |
679 clrb | |
680 | |
2466 | 681 puls x,y,u,pc |
2463 | 682 |
2445 | 683 |
684 * SS.FDInf - | |
685 * Entry: A = path | |
686 * B = SS.FDInf | |
687 * X = ptr to 256 byte buffer | |
688 * Y = msb - Length of read | |
689 * lsb - MSB of LSN | |
690 * U = LSW of LSN | |
691 GstFDInf | |
692 rts | |
693 | |
2658
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
694 * SS.DirEnt - |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
695 * Entry: A = path |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
696 * B = SS.DirEnt |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
697 * X = ptr to 64 byte buffer |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
698 GstDirEnt |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
699 ldx PD.DEV,y |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
700 ldx V$STAT,x |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
701 pshs x,y,u |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
702 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
703 * send caller's Y (do we really need this to be 16bit? X points to 256byte buff? |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
704 ldx R$Y,u |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
705 pshs x |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
706 leax ,s |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
707 ldy #2 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
708 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
709 * set U to dwsub |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
710 ifgt Level-1 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
711 ldu <D.DWSubAddr |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
712 else |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
713 ldu >D.DWSubAddr |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
714 endc |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
715 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
716 jsr 6,u |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
717 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
718 * recv bytes into v.buf |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
719 puls y |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
720 ldx ,s ; V$STAT |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
721 ldx V.BUF,x |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
722 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
723 ifgt Level-1 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
724 pshs x |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
725 endc |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
726 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
727 jsr 3,u |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
728 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
729 ifgt Level-1 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
730 * move v.buf into caller |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
731 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
732 ldx 4,s |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
733 ldu R$X,x ; U = caller's X = dest ptr |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
734 sty R$Y,x ; do we need to set this for caller? |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
735 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
736 lda <D.SysTsk ; A = system task # |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
737 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
738 ldx <D.Proc get calling proc desc |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
739 ldb P$Task,x ; B = callers task # |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
740 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
741 puls x ; V.BUF from earlier |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
742 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
743 * F$Move the bytes (seems to work) |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
744 os9 F$Move |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
745 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
746 else |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
747 endc |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
748 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
749 * assume everything worked (not good) |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
750 clrb |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
751 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
752 puls x,y,u,pc |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
753 |
fbf145e9d668
Renamed rfmdefs to rfm.d
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
754 |
2445 | 755 |
756 | |
2461 | 757 ****************************** |
2445 | 758 * |
2461 | 759 * SetStat - change status of file on the remote device |
2445 | 760 * |
2461 | 761 * Entry: Y = Path descriptor pointer |
762 * U = Callers register stack pointer | |
2445 | 763 * |
2461 | 764 * Exit: CC.Carry = 0 (no error), 1 (error) |
765 * B = error code (if CC.Carry == 1) | |
2445 | 766 * |
2450 | 767 setstt |
768 lda #DW.setstt | |
2445 | 769 lbsr sendit |
770 | |
771 ldb R$B,u | |
772 beq SstOpt | |
773 cmpb #SS.Size | |
774 beq SstSize | |
775 cmpb #SS.FD | |
776 beq SstFD | |
777 cmpb #SS.Lock | |
778 beq SstLock | |
779 cmpb #SS.RsBit | |
780 beq SstRsBit | |
781 cmpb #SS.Attr | |
782 beq SstAttr | |
783 cmpb #SS.FSig | |
784 beq SstFSig | |
785 comb | |
786 ldb #E$UnkSvc | |
787 rts | |
788 | |
789 SstOpt | |
790 SstSize | |
2466 | 791 rts |
792 | |
793 * Entry: A = path | |
794 * B = SS.FD | |
795 * X = ptr to 256 byte buffer | |
796 * Y = # of bytes of FD to write | |
797 | |
798 * path # and SS.FD already sent to server, so | |
799 * send Y, recv Y bytes, get them into caller at X | |
800 * Y and U here are still as at entry | |
801 SstFD | |
802 ldx PD.DEV,y | |
803 ldx V$STAT,x | |
804 pshs x,y,u | |
805 | |
806 * send caller's Y (do we really need this to be 16bit? X points to 256byte buff? | |
807 ldx R$Y,u | |
808 pshs x | |
809 leax ,s | |
810 ldy #2 | |
811 | |
812 * set U to dwsub | |
813 ifgt Level-1 | |
814 ldu <D.DWSubAddr | |
815 else | |
816 ldu >D.DWSubAddr | |
817 endc | |
818 jsr 6,u | |
819 | |
2467 | 820 ifgt Level-1 |
821 * move caller bytes into v.buf | |
2466 | 822 |
823 puls y ; get number of bytes pushed earlier | |
824 ldx 4,s | |
825 ldx R$X,x ; U = caller's X = dest ptr | |
826 ldu ,s | |
827 ldu V.BUF,u | |
828 | |
829 ldx <D.Proc get calling proc desc | |
830 lda P$Task,x ; A = callers task # | |
831 | |
832 ldb <D.SysTsk ; B = system task # | |
833 | |
834 | |
835 * F$Move the bytes (seems to work) | |
836 os9 F$Move | |
2467 | 837 |
2466 | 838 * write bytes from v.buf |
839 tfr u,x | |
840 | |
841 ifgt Level-1 | |
842 ldu <D.DWSubAddr | |
843 else | |
844 ldu >D.DWSubAddr | |
845 endc | |
2467 | 846 |
847 else | |
848 puls y | |
849 ldx 4,s | |
850 ldx R$X,x | |
851 endc | |
852 | |
2466 | 853 |
2467 | 854 jsr 6,u |
2466 | 855 |
856 * assume everything worked (not good) | |
857 clrb | |
858 | |
859 puls x,y,u,pc | |
860 | |
861 | |
2445 | 862 SstLock |
863 SstRsBit | |
864 SstAttr | |
865 SstFSig | |
866 rts | |
867 | |
868 | |
2461 | 869 ****************************** |
870 * | |
871 * Close - close path to file on the remote device | |
872 * | |
873 * Entry: Y = Path descriptor pointer | |
874 * U = Callers register stack pointer | |
875 * | |
876 * Exit: CC.Carry = 0 (no error), 1 (error) | |
877 * B = error code (if CC.Carry == 1) | |
878 * | |
2450 | 879 close |
880 pshs y,u | |
2445 | 881 |
882 * put path # on stack | |
2450 | 883 lda PD.PD,y |
2445 | 884 pshs a |
885 | |
886 * put rfm op and DW op on stack | |
887 ldb #DW.close | |
888 lda #OP_VFM | |
889 pshs d | |
890 | |
891 leax ,s ; point X to stack | |
892 ldy #3 ; 3 bytes to send | |
893 ifgt Level-1 | |
894 ldu <D.DWSubAddr | |
895 else | |
896 ldu >D.DWSubAddr | |
897 endc | |
898 | |
899 jsr 6,u | |
900 leas 2,s ;clean stack (leave 1 byte) | |
901 | |
902 * read server response | |
903 leax ,s | |
904 ldy #1 | |
905 jsr 3,u | |
906 | |
907 * free system mem | |
908 ldd #256 | |
909 ldx 1,s ; orig Y | |
910 ldx PD.DEV,x | |
2454 | 911 ldx V$STAT,x |
2445 | 912 ldu V.BUF,x |
913 os9 F$SRtMem | |
914 | |
2450 | 915 puls b ; server sends result code |
916 tstb | |
2445 | 917 beq close1 |
2450 | 918 coma ; set error flag if != 0 |
919 close1 puls u,y,pc | |
2445 | 920 |
921 | |
2460 | 922 * send dwop, rfmop, path, set/getstat op (path is in A) |
923 sendgstt pshs x,y,u | |
924 | |
925 ldb R$B,u | |
926 pshs d | |
927 | |
928 lda #OP_VFM ; load command | |
929 ldb #DW.getstt | |
930 pshs d ; command store on stack | |
931 leax ,s ; point X to stack | |
932 ldy #4 ; 2 byte to send | |
933 ifgt Level-1 | |
934 ldu <D.DWSubAddr | |
935 else | |
936 ldu >D.DWSubAddr | |
937 endc | |
938 | |
939 jsr 6,u | |
940 leas 4,s ;clean stack | |
941 | |
942 clrb | |
943 puls x,y,u,pc | |
944 | |
945 | |
946 | |
947 | |
948 | |
2435 | 949 * just send OP_VMF + vfmop |
2446 | 950 sendit pshs a,x,y,u |
2435 | 951 |
2445 | 952 lda #OP_VFM ; load command |
953 pshs a ; command store on stack | |
954 leax ,s ; point X to stack | |
955 ldy #2 ; 2 byte to send | |
956 ifgt Level-1 | |
957 ldu <D.DWSubAddr | |
958 else | |
959 ldu >D.DWSubAddr | |
960 endc | |
2435 | 961 |
2445 | 962 jsr 6,u |
963 leas 2,s ;clean stack | |
964 | |
965 clrb | |
2446 | 966 puls x,y,u,pc |
2445 | 967 |
968 emod | |
969 eom equ * | |
970 end | |
971 |