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
|
|
17 use rfmdefs
|
|
18 use dwdefs.d
|
|
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
|
2470
|
577 * comb
|
|
578 * ldb #E$UnkSvc
|
|
579 clrb
|
2445
|
580 rts
|
|
581
|
|
582 * SS.OPT
|
2462
|
583 * RFM does nothing here, so we do nothing
|
2445
|
584 GstOPT
|
|
585 rts
|
|
586
|
|
587 * SS.EOF
|
|
588 * Entry A = path
|
|
589 * B = SS.EOF
|
|
590 GstEOF
|
|
591 rts
|
|
592
|
|
593 * SS.Ready - Check for data available on path
|
|
594 * Entry A = path
|
|
595 * B = SS.Ready
|
|
596 GstReady
|
|
597 clr R$B,u always mark no data ready
|
|
598 rts
|
|
599
|
|
600 * SS.Size - Return size of file opened on path
|
|
601 * Entry A = path
|
|
602 * B = SS.SIZ
|
|
603 * Exit X = msw of files size
|
|
604 * U = lsw of files size
|
|
605 GstSize
|
|
606 rts
|
|
607
|
|
608 * SS.Pos - Return the current position in the file
|
|
609 * Entry A = path
|
|
610 * B = SS.Pos
|
|
611 * Exit X = msw of pos
|
|
612 * U = lsw of pos
|
|
613 GstPOS
|
|
614 rts
|
|
615
|
|
616 * SS.FD - Return file descriptor sector
|
|
617 * Entry: A = path
|
|
618 * B = SS.FD
|
|
619 * X = ptr to 256 byte buffer
|
|
620 * Y = # of bytes of FD required
|
|
621
|
2463
|
622 * path # and SS.FD already sent to server, so
|
|
623 * send Y, recv Y bytes, get them into caller at X
|
|
624 * Y and U here are still as at entry
|
|
625 GstFD
|
2466
|
626 ldx PD.DEV,y
|
|
627 ldx V$STAT,x
|
|
628 pshs x,y,u
|
2463
|
629
|
|
630 * send caller's Y (do we really need this to be 16bit? X points to 256byte buff?
|
2466
|
631 ldx R$Y,u
|
2463
|
632 pshs x
|
|
633 leax ,s
|
|
634 ldy #2
|
|
635
|
|
636 * set U to dwsub
|
|
637 ifgt Level-1
|
|
638 ldu <D.DWSubAddr
|
|
639 else
|
|
640 ldu >D.DWSubAddr
|
|
641 endc
|
|
642
|
|
643 jsr 6,u
|
|
644
|
|
645 * recv bytes into v.buf
|
|
646 puls y
|
2466
|
647 ldx ,s ; V$STAT
|
2463
|
648 ldx V.BUF,x
|
2467
|
649
|
|
650 ifgt Level-1
|
2463
|
651 pshs x
|
2467
|
652 endc
|
2463
|
653
|
|
654 jsr 3,u
|
2467
|
655
|
|
656 ifgt Level-1
|
2463
|
657 * move v.buf into caller
|
|
658
|
|
659 ldx 4,s
|
|
660 ldu R$X,x ; U = caller's X = dest ptr
|
|
661 sty R$Y,x ; do we need to set this for caller?
|
|
662
|
|
663 lda <D.SysTsk ; A = system task #
|
|
664
|
|
665 ldx <D.Proc get calling proc desc
|
|
666 ldb P$Task,x ; B = callers task #
|
|
667
|
|
668 puls x ; V.BUF from earlier
|
2467
|
669
|
2463
|
670 * F$Move the bytes (seems to work)
|
|
671 os9 F$Move
|
|
672
|
2467
|
673 else
|
|
674 endc
|
|
675
|
2463
|
676 * assume everything worked (not good)
|
|
677 clrb
|
|
678
|
2466
|
679 puls x,y,u,pc
|
2463
|
680
|
2445
|
681
|
|
682 * SS.FDInf -
|
|
683 * Entry: A = path
|
|
684 * B = SS.FDInf
|
|
685 * X = ptr to 256 byte buffer
|
|
686 * Y = msb - Length of read
|
|
687 * lsb - MSB of LSN
|
|
688 * U = LSW of LSN
|
|
689 GstFDInf
|
|
690 rts
|
|
691
|
|
692
|
|
693
|
2461
|
694 ******************************
|
2445
|
695 *
|
2461
|
696 * SetStat - change status of file on the remote device
|
2445
|
697 *
|
2461
|
698 * Entry: Y = Path descriptor pointer
|
|
699 * U = Callers register stack pointer
|
2445
|
700 *
|
2461
|
701 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
702 * B = error code (if CC.Carry == 1)
|
2445
|
703 *
|
2450
|
704 setstt
|
|
705 lda #DW.setstt
|
2445
|
706 lbsr sendit
|
|
707
|
|
708 ldb R$B,u
|
|
709 beq SstOpt
|
|
710 cmpb #SS.Size
|
|
711 beq SstSize
|
|
712 cmpb #SS.FD
|
|
713 beq SstFD
|
|
714 cmpb #SS.Lock
|
|
715 beq SstLock
|
|
716 cmpb #SS.RsBit
|
|
717 beq SstRsBit
|
|
718 cmpb #SS.Attr
|
|
719 beq SstAttr
|
|
720 cmpb #SS.FSig
|
|
721 beq SstFSig
|
|
722 comb
|
|
723 ldb #E$UnkSvc
|
|
724 rts
|
|
725
|
|
726 SstOpt
|
|
727 SstSize
|
2466
|
728 rts
|
|
729
|
|
730 * Entry: A = path
|
|
731 * B = SS.FD
|
|
732 * X = ptr to 256 byte buffer
|
|
733 * Y = # of bytes of FD to write
|
|
734
|
|
735 * path # and SS.FD already sent to server, so
|
|
736 * send Y, recv Y bytes, get them into caller at X
|
|
737 * Y and U here are still as at entry
|
|
738 SstFD
|
|
739 ldx PD.DEV,y
|
|
740 ldx V$STAT,x
|
|
741 pshs x,y,u
|
|
742
|
|
743 * send caller's Y (do we really need this to be 16bit? X points to 256byte buff?
|
|
744 ldx R$Y,u
|
|
745 pshs x
|
|
746 leax ,s
|
|
747 ldy #2
|
|
748
|
|
749 * set U to dwsub
|
|
750 ifgt Level-1
|
|
751 ldu <D.DWSubAddr
|
|
752 else
|
|
753 ldu >D.DWSubAddr
|
|
754 endc
|
|
755 jsr 6,u
|
|
756
|
2467
|
757 ifgt Level-1
|
|
758 * move caller bytes into v.buf
|
2466
|
759
|
|
760 puls y ; get number of bytes pushed earlier
|
|
761 ldx 4,s
|
|
762 ldx R$X,x ; U = caller's X = dest ptr
|
|
763 ldu ,s
|
|
764 ldu V.BUF,u
|
|
765
|
|
766 ldx <D.Proc get calling proc desc
|
|
767 lda P$Task,x ; A = callers task #
|
|
768
|
|
769 ldb <D.SysTsk ; B = system task #
|
|
770
|
|
771
|
|
772 * F$Move the bytes (seems to work)
|
|
773 os9 F$Move
|
2467
|
774
|
2466
|
775 * write bytes from v.buf
|
|
776 tfr u,x
|
|
777
|
|
778 ifgt Level-1
|
|
779 ldu <D.DWSubAddr
|
|
780 else
|
|
781 ldu >D.DWSubAddr
|
|
782 endc
|
2467
|
783
|
|
784 else
|
|
785 puls y
|
|
786 ldx 4,s
|
|
787 ldx R$X,x
|
|
788 endc
|
|
789
|
2466
|
790
|
2467
|
791 jsr 6,u
|
2466
|
792
|
|
793 * assume everything worked (not good)
|
|
794 clrb
|
|
795
|
|
796 puls x,y,u,pc
|
|
797
|
|
798
|
2445
|
799 SstLock
|
|
800 SstRsBit
|
|
801 SstAttr
|
|
802 SstFSig
|
|
803 rts
|
|
804
|
|
805
|
2461
|
806 ******************************
|
|
807 *
|
|
808 * Close - close path to file on the remote device
|
|
809 *
|
|
810 * Entry: Y = Path descriptor pointer
|
|
811 * U = Callers register stack pointer
|
|
812 *
|
|
813 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
814 * B = error code (if CC.Carry == 1)
|
|
815 *
|
2450
|
816 close
|
|
817 pshs y,u
|
2445
|
818
|
|
819 * put path # on stack
|
2450
|
820 lda PD.PD,y
|
2445
|
821 pshs a
|
|
822
|
|
823 * put rfm op and DW op on stack
|
|
824 ldb #DW.close
|
|
825 lda #OP_VFM
|
|
826 pshs d
|
|
827
|
|
828 leax ,s ; point X to stack
|
|
829 ldy #3 ; 3 bytes to send
|
|
830 ifgt Level-1
|
|
831 ldu <D.DWSubAddr
|
|
832 else
|
|
833 ldu >D.DWSubAddr
|
|
834 endc
|
|
835
|
|
836 jsr 6,u
|
|
837 leas 2,s ;clean stack (leave 1 byte)
|
|
838
|
|
839 * read server response
|
|
840 leax ,s
|
|
841 ldy #1
|
|
842 jsr 3,u
|
|
843
|
|
844 * free system mem
|
|
845 ldd #256
|
|
846 ldx 1,s ; orig Y
|
|
847 ldx PD.DEV,x
|
2454
|
848 ldx V$STAT,x
|
2445
|
849 ldu V.BUF,x
|
|
850 os9 F$SRtMem
|
|
851
|
2450
|
852 puls b ; server sends result code
|
|
853 tstb
|
2445
|
854 beq close1
|
2450
|
855 coma ; set error flag if != 0
|
|
856 close1 puls u,y,pc
|
2445
|
857
|
|
858
|
2460
|
859 * send dwop, rfmop, path, set/getstat op (path is in A)
|
|
860 sendgstt pshs x,y,u
|
|
861
|
|
862 ldb R$B,u
|
|
863 pshs d
|
|
864
|
|
865 lda #OP_VFM ; load command
|
|
866 ldb #DW.getstt
|
|
867 pshs d ; command store on stack
|
|
868 leax ,s ; point X to stack
|
|
869 ldy #4 ; 2 byte to send
|
|
870 ifgt Level-1
|
|
871 ldu <D.DWSubAddr
|
|
872 else
|
|
873 ldu >D.DWSubAddr
|
|
874 endc
|
|
875
|
|
876 jsr 6,u
|
|
877 leas 4,s ;clean stack
|
|
878
|
|
879 clrb
|
|
880 puls x,y,u,pc
|
|
881
|
|
882
|
|
883
|
|
884
|
|
885
|
2435
|
886 * just send OP_VMF + vfmop
|
2446
|
887 sendit pshs a,x,y,u
|
2435
|
888
|
2445
|
889 lda #OP_VFM ; load command
|
|
890 pshs a ; command store on stack
|
|
891 leax ,s ; point X to stack
|
|
892 ldy #2 ; 2 byte to send
|
|
893 ifgt Level-1
|
|
894 ldu <D.DWSubAddr
|
|
895 else
|
|
896 ldu >D.DWSubAddr
|
|
897 endc
|
2435
|
898
|
2445
|
899 jsr 6,u
|
|
900 leas 2,s ;clean stack
|
|
901
|
|
902 clrb
|
2446
|
903 puls x,y,u,pc
|
2445
|
904
|
|
905 emod
|
|
906 eom equ *
|
|
907 end
|
|
908
|