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
|
|
115 * put command byte & path # on stack
|
|
116 lda V.DWCMD,x
|
2456
|
117 ldy 2,s
|
2447
|
118 ldb PD.PD,y
|
|
119 pshs cc
|
2454
|
120 pshs d ; p# PD.PD Regs
|
2447
|
121
|
|
122 * put rfm op and DW op on stack
|
|
123 lda #OP_VFM
|
2454
|
124 pshs a ; DWOP RFMOP p# PD.PD Regs
|
2447
|
125
|
2445
|
126 leax ,s ; point X to stack
|
|
127 ldy #3 ; 3 bytes to send
|
|
128
|
|
129 ifgt Level-1
|
|
130 ldu <D.DWSubAddr
|
|
131 else
|
|
132 ldu >D.DWSubAddr
|
|
133 endc
|
|
134
|
2447
|
135 orcc #IntMasks
|
2445
|
136 jsr 6,u
|
2454
|
137 leas 3,s ;clean stack PD.PD Regs
|
2445
|
138
|
2462
|
139 ifgt Level-1
|
2445
|
140 * now send path string
|
2450
|
141 * move from caller to our mem
|
2444
|
142
|
2450
|
143 ldx <D.Proc get calling proc desc
|
|
144 lda P$Task,x ; A = callers task # (source)
|
2445
|
145
|
2450
|
146 ldb <D.SysTsk ; B = system task # (dest)
|
2462
|
147 endc
|
|
148
|
2450
|
149 ldx 1,s ; get device mem ptr
|
2467
|
150 ifgt Level-1
|
2450
|
151 ldu V.BUF,x ; get destination pointer in U
|
2467
|
152 endc
|
2450
|
153 ldy V.PATHNAMELEN,x ; get count in Y
|
|
154 ldx V.PATHNAME,x ; get source in X
|
2445
|
155
|
2462
|
156 ifgt Level-1
|
2450
|
157 * F$Move the bytes (seems to work)
|
|
158 os9 F$Move
|
|
159 bcs moverr
|
2462
|
160 endc
|
|
161
|
2450
|
162 * Add carriage return
|
2467
|
163 ifgt Level-1
|
2450
|
164 tfr u,x
|
2467
|
165 else
|
|
166 tfr x,u
|
|
167 endc
|
2450
|
168 tfr y,d
|
|
169 leau d,u
|
|
170 lda #C$CR
|
|
171 sta ,u
|
|
172 leay 1,y
|
2436
|
173
|
2445
|
174 * send to server
|
2450
|
175 ifgt Level-1
|
|
176 ldu <D.DWSubAddr
|
|
177 else
|
|
178 ldu >D.DWSubAddr
|
|
179 endc
|
2445
|
180 jsr 6,u
|
|
181
|
|
182 * read response from server -> B
|
2450
|
183 clr ,-s
|
2445
|
184 leax ,s
|
|
185 ldy #1
|
|
186 jsr 3,u
|
|
187
|
|
188 * pull server's response into B
|
2454
|
189 puls b ; PD.PD Regs
|
2450
|
190 moverr puls cc
|
2445
|
191 tstb
|
|
192 beq open2
|
|
193
|
2450
|
194 openerr coma ; set error
|
2452
|
195 open2 puls x,y,u,pc
|
2445
|
196
|
2462
|
197
|
|
198 ******************************
|
|
199 *
|
|
200 * MakDir - creates a directory on the remote device
|
|
201 *
|
|
202 * Entry: Y = Path descriptor pointer
|
|
203 * U = Callers register stack pointer
|
|
204 *
|
|
205 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
206 * B = error code (if CC.Carry == 1)
|
|
207 *
|
2445
|
208 makdir lda #DW.makdir
|
|
209 lbra sendit
|
2462
|
210
|
|
211 ******************************
|
|
212 *
|
|
213 * ChgDir - changes the data/execution directory on the remote device
|
|
214 *
|
|
215 * Entry: Y = Path descriptor pointer
|
|
216 * U = Callers register stack pointer
|
|
217 *
|
|
218 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
219 * B = error code (if CC.Carry == 1)
|
|
220 *
|
2445
|
221 chgdir lda #DW.chgdir
|
|
222 lbra sendit
|
2462
|
223
|
|
224 ******************************
|
|
225 *
|
|
226 * Delete - delete a file on the remote device
|
|
227 *
|
|
228 * Entry: Y = Path descriptor pointer
|
|
229 * U = Callers register stack pointer
|
|
230 *
|
|
231 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
232 * B = error code (if CC.Carry == 1)
|
|
233 *
|
2445
|
234 delete lda #DW.delete
|
|
235 lbra sendit
|
2460
|
236
|
|
237
|
2461
|
238 ******************************
|
|
239 *
|
|
240 * Seek - seeks into a file on the remote device
|
|
241 *
|
|
242 * Entry: Y = Path descriptor pointer
|
|
243 * U = Callers register stack pointer
|
|
244 *
|
2462
|
245 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
246 * B = error code (if CC.Carry == 1)
|
|
247 *
|
2460
|
248 * seek = send dwop, rfmop, path, caller's X + U
|
2462
|
249 seek pshs y,u
|
2460
|
250
|
|
251 ldx R$U,u
|
|
252 pshs x
|
|
253 ldx R$X,u
|
|
254 pshs x
|
|
255 lda PD.PD,y
|
|
256 pshs a
|
2462
|
257 ldd #OP_VFM*256+DW.seek
|
2460
|
258 pshs d
|
|
259
|
2462
|
260 leax ,s ; point X to stack
|
|
261 ldy #7 ; 7 bytes to send
|
2460
|
262
|
|
263 * set U to dwsub
|
2462
|
264 ifgt Level-1
|
|
265 ldu <D.DWSubAddr
|
|
266 else
|
|
267 ldu >D.DWSubAddr
|
|
268 endc
|
2460
|
269
|
|
270 * send dw op, rfm op, path #
|
2462
|
271 jsr 6,u
|
|
272 leas 7,s ;clean stack - PD.PD Regs
|
2460
|
273
|
2462
|
274 clrb
|
|
275 puls y,u,pc
|
2460
|
276
|
2436
|
277
|
2461
|
278 ******************************
|
|
279 *
|
|
280 * Read - reads data from a file on the remote device
|
|
281 *
|
|
282 * Entry: Y = Path descriptor pointer
|
|
283 * U = Callers register stack pointer
|
|
284 *
|
2462
|
285 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
286 * B = error code (if CC.Carry == 1)
|
|
287 *
|
|
288 read ldb #DW.read
|
|
289 bra read1 ; join readln routine
|
2445
|
290
|
|
291
|
|
292
|
2461
|
293 ******************************
|
|
294 *
|
|
295 * Write - writes data to a file on the remote device
|
|
296 *
|
|
297 * Entry: Y = Path descriptor pointer
|
|
298 * U = Callers register stack pointer
|
|
299 *
|
2462
|
300 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
301 * B = error code (if CC.Carry == 1)
|
|
302 *
|
2464
|
303 write ldb #DW.write
|
|
304 lbra write1
|
2445
|
305
|
|
306
|
|
307
|
2461
|
308 ******************************
|
|
309 *
|
|
310 * ReadLn - reads a line of data from a file on the remote device
|
|
311 *
|
|
312 * Entry: Y = Path descriptor pointer
|
|
313 * U = Callers register stack pointer
|
|
314 *
|
2462
|
315 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
316 * B = error code (if CC.Carry == 1)
|
|
317 *
|
2445
|
318 readln ldb #DW.readln
|
2447
|
319 read1 ldx PD.DEV,y ; to our static storage
|
2454
|
320 ldx V$STAT,x
|
2447
|
321 pshs x,y,u
|
2445
|
322
|
|
323 * put path # on stack
|
2447
|
324 lda PD.PD,y
|
|
325 pshs cc
|
2454
|
326 pshs a ; p# PD.PD Regs
|
2445
|
327
|
|
328 * put rfm op and DW op on stack
|
|
329
|
|
330 lda #OP_VFM
|
2454
|
331 pshs d ; DWOP RFMOP p# PD.PD Regs
|
2445
|
332
|
|
333 leax ,s ; point X to stack
|
|
334 ldy #3 ; 3 bytes to send
|
|
335
|
|
336 * set U to dwsub
|
|
337 ifgt Level-1
|
|
338 ldu <D.DWSubAddr
|
|
339 else
|
|
340 ldu >D.DWSubAddr
|
|
341 endc
|
|
342
|
|
343 * send dw op, rfm op, path #
|
2447
|
344 orcc #IntMasks
|
2445
|
345 jsr 6,u
|
2454
|
346 leas 3,s ;clean stack - PD.PD Regs
|
2445
|
347
|
|
348 * put caller's Y on stack (maximum allowed bytes)
|
2447
|
349 ldx 5,s
|
2445
|
350 ldx R$Y,x
|
|
351 pshs x
|
|
352
|
|
353 * send 2 bytes from stack
|
|
354 leax ,s
|
|
355 ldy #2
|
|
356 jsr 6,u
|
|
357
|
|
358 leas 1,s ; leave 1 byte for server response in next section
|
|
359
|
|
360 * read # bytes coming (0 = eof) from server
|
|
361 leax ,s
|
|
362 ldy #1
|
|
363 jsr 3,u
|
|
364
|
|
365 * store size
|
|
366 clra
|
2454
|
367 puls b ;PD.PD Regs
|
2445
|
368
|
|
369
|
|
370 * check for 0
|
2447
|
371 tstb
|
2445
|
372 beq readln1 ; 0 bytes = EOF
|
|
373
|
|
374 * read the data from server if > 0
|
2454
|
375 go_on pshs d ;xfersz PD.PD Regs
|
2445
|
376
|
|
377 * load data from server into mem block
|
2467
|
378 ifgt Level-1
|
2455
|
379 ldx 3,s ; V$STAT
|
2445
|
380 ldx V.BUF,x
|
2467
|
381 else
|
|
382 ldx 7,s ; caller regs
|
|
383 std R$Y,x
|
|
384 ldx R$X,x
|
|
385 endc
|
2445
|
386 ldy ,s ;xfersz
|
|
387 jsr 3,u
|
|
388
|
|
389 * F$Move
|
|
390 * a = my task #
|
|
391 * b = caller's task #
|
|
392 * X = source ptr
|
|
393 * Y = byte count
|
|
394 * U = dest ptr
|
|
395
|
|
396 * move from our mem to caller
|
|
397
|
2454
|
398 puls y ;Y = byte count (already set?) - PD.PD Regs
|
2447
|
399 puls cc
|
2445
|
400
|
2462
|
401 ifgt Level-1
|
2445
|
402 ldx 4,s
|
|
403 ldu R$X,x ; U = caller's X = dest ptr
|
2450
|
404 sty R$Y,x
|
|
405
|
2445
|
406 lda <D.SysTsk ; A = system task #
|
|
407
|
|
408 ldx <D.Proc get calling proc desc
|
|
409 ldb P$Task,x ; B = callers task #
|
|
410
|
2467
|
411 ldx ,s ; V$STAT - PD Regs
|
2445
|
412 ldx V.BUF,x
|
|
413
|
|
414 * F$Move the bytes (seems to work)
|
|
415 os9 F$Move
|
2462
|
416 endc
|
2445
|
417 * assume everything worked (not good)
|
|
418 clrb
|
|
419 bra readln2
|
|
420
|
2447
|
421 readln1
|
|
422 puls cc
|
|
423 comb
|
|
424 ldb #E$EOF
|
2467
|
425 readln2 puls x,y,u,pc
|
2436
|
426
|
2445
|
427
|
2464
|
428
|
|
429
|
2461
|
430 ******************************
|
|
431 *
|
|
432 * WritLn - writes a line of data to a file on the remote device
|
|
433 *
|
|
434 * Entry: Y = Path descriptor pointer
|
|
435 * U = Callers register stack pointer
|
|
436 *
|
2462
|
437 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
438 * B = error code (if CC.Carry == 1)
|
|
439 *
|
2464
|
440 writln ldb #DW.writln
|
|
441
|
|
442 write1 ldx PD.DEV,y ; to our static storage
|
|
443 ldx V$STAT,x
|
|
444 pshs x,y,u ; Vstat pd regs
|
|
445
|
|
446 * put path # on stack
|
|
447 lda PD.PD,y
|
|
448 pshs cc ; cc vstat pd regs
|
|
449 pshs a ; p# cc vstat PD Regs
|
|
450
|
|
451 * put rfm op and DW op on stack
|
|
452
|
|
453 lda #OP_VFM
|
|
454 pshs d ; DWOP RFMOP p# cc vstat PD.PD Regs
|
|
455
|
|
456 leax ,s ; point X to stack
|
|
457 ldy #3 ; 3 bytes to send
|
|
458
|
|
459 * set U to dwsub
|
|
460 ifgt Level-1
|
|
461 ldu <D.DWSubAddr
|
|
462 else
|
|
463 ldu >D.DWSubAddr
|
|
464 endc
|
|
465
|
|
466 * send dw op, rfm op, path #
|
|
467 orcc #IntMasks
|
|
468 jsr 6,u
|
|
469 leas 3,s ;clean stack - cc vstat PD.PD Regs
|
|
470
|
|
471 * put caller's Y on stack (maximum allowed bytes)
|
|
472 ldx 5,s
|
|
473 ldx R$Y,x
|
|
474 pshs x ;bytes cc vstat PD.PD Regs
|
|
475
|
|
476 * send 2 bytes from stack
|
|
477 leax ,s
|
|
478 ldy #2
|
|
479 jsr 6,u
|
|
480
|
|
481 * move caller's data into our buf
|
2445
|
482
|
2464
|
483 * F$Move
|
|
484 * a = my task #
|
|
485 * b = caller's task #
|
|
486 * X = source ptr
|
|
487 * Y = byte count
|
|
488 * U = dest ptr
|
|
489
|
|
490 puls y ;Y = byte count (already set?) cc vstat PD.PD Regs
|
|
491
|
|
492 ifgt Level-1
|
|
493
|
|
494 ldb <D.SysTsk ; dst B = us
|
|
495
|
|
496 pshs u ; dwsub cc vstat PD.PD Regs
|
|
497 ldx 3,s
|
|
498 ldu V.BUF,x ; dst U = our v.buf
|
|
499
|
|
500 ldx <D.Proc get calling proc desc
|
|
501 lda P$Task,x ; src A = callers task #
|
|
502
|
|
503 ldx 7,s ; orig U
|
|
504 ldx R$X,x ; src = caller's X
|
|
505
|
|
506
|
|
507 * F$Move the bytes
|
|
508 os9 F$Move
|
|
509
|
|
510 * send v.buf to server
|
|
511
|
|
512 puls u ; cc vstat PD.PD Regs
|
|
513 ldx 1,s
|
|
514 ldx V.BUF,x
|
2470
|
515 else
|
|
516 ldx 5,s
|
|
517 ldx R$X,x
|
|
518 endc
|
2464
|
519
|
|
520 jsr 6,u
|
|
521
|
|
522 puls cc ; vstat PD.PD Regs
|
|
523 bra writln2
|
|
524 * error exit?
|
|
525
|
2465
|
526 writln2 puls x,y,u,pc
|
2464
|
527
|
|
528
|
|
529
|
|
530
|
|
531
|
|
532
|
|
533
|
|
534
|
2461
|
535 ******************************
|
2445
|
536 *
|
2461
|
537 * GetStat - obtain status of file on the remote device
|
2445
|
538 *
|
2461
|
539 * Entry: Y = Path descriptor pointer
|
|
540 * U = Callers register stack pointer
|
2445
|
541 *
|
2461
|
542 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
543 * B = error code (if CC.Carry == 1)
|
2445
|
544 *
|
|
545 getstt
|
2463
|
546 lda PD.PD,y
|
2460
|
547 lbsr sendgstt
|
2445
|
548
|
|
549 ldb R$B,u get function code
|
|
550 beq GstOPT
|
|
551 cmpb #SS.EOF
|
|
552 beq GstEOF
|
|
553 cmpb #SS.Ready
|
|
554 beq GstReady
|
|
555 cmpb #SS.Size
|
|
556 beq GstSize
|
|
557 cmpb #SS.Pos
|
|
558 beq GstPos
|
|
559 cmpb #SS.FD
|
|
560 beq GstFD
|
|
561 cmpb #SS.FDInf
|
|
562 beq GstFDInf
|
2470
|
563 * comb
|
|
564 * ldb #E$UnkSvc
|
|
565 clrb
|
2445
|
566 rts
|
|
567
|
|
568 * SS.OPT
|
2462
|
569 * RFM does nothing here, so we do nothing
|
2445
|
570 GstOPT
|
|
571 rts
|
|
572
|
|
573 * SS.EOF
|
|
574 * Entry A = path
|
|
575 * B = SS.EOF
|
|
576 GstEOF
|
|
577 rts
|
|
578
|
|
579 * SS.Ready - Check for data available on path
|
|
580 * Entry A = path
|
|
581 * B = SS.Ready
|
|
582 GstReady
|
|
583 clr R$B,u always mark no data ready
|
|
584 rts
|
|
585
|
|
586 * SS.Size - Return size of file opened on path
|
|
587 * Entry A = path
|
|
588 * B = SS.SIZ
|
|
589 * Exit X = msw of files size
|
|
590 * U = lsw of files size
|
|
591 GstSize
|
|
592 rts
|
|
593
|
|
594 * SS.Pos - Return the current position in the file
|
|
595 * Entry A = path
|
|
596 * B = SS.Pos
|
|
597 * Exit X = msw of pos
|
|
598 * U = lsw of pos
|
|
599 GstPOS
|
|
600 rts
|
|
601
|
|
602 * SS.FD - Return file descriptor sector
|
|
603 * Entry: A = path
|
|
604 * B = SS.FD
|
|
605 * X = ptr to 256 byte buffer
|
|
606 * Y = # of bytes of FD required
|
|
607
|
2463
|
608 * path # and SS.FD already sent to server, so
|
|
609 * send Y, recv Y bytes, get them into caller at X
|
|
610 * Y and U here are still as at entry
|
|
611 GstFD
|
2466
|
612 ldx PD.DEV,y
|
|
613 ldx V$STAT,x
|
|
614 pshs x,y,u
|
2463
|
615
|
|
616 * send caller's Y (do we really need this to be 16bit? X points to 256byte buff?
|
2466
|
617 ldx R$Y,u
|
2463
|
618 pshs x
|
|
619 leax ,s
|
|
620 ldy #2
|
|
621
|
|
622 * set U to dwsub
|
|
623 ifgt Level-1
|
|
624 ldu <D.DWSubAddr
|
|
625 else
|
|
626 ldu >D.DWSubAddr
|
|
627 endc
|
|
628
|
|
629 jsr 6,u
|
|
630
|
|
631 * recv bytes into v.buf
|
|
632 puls y
|
2466
|
633 ldx ,s ; V$STAT
|
2463
|
634 ldx V.BUF,x
|
2467
|
635
|
|
636 ifgt Level-1
|
2463
|
637 pshs x
|
2467
|
638 endc
|
2463
|
639
|
|
640 jsr 3,u
|
2467
|
641
|
|
642 ifgt Level-1
|
2463
|
643 * move v.buf into caller
|
|
644
|
|
645 ldx 4,s
|
|
646 ldu R$X,x ; U = caller's X = dest ptr
|
|
647 sty R$Y,x ; do we need to set this for caller?
|
|
648
|
|
649 lda <D.SysTsk ; A = system task #
|
|
650
|
|
651 ldx <D.Proc get calling proc desc
|
|
652 ldb P$Task,x ; B = callers task #
|
|
653
|
|
654 puls x ; V.BUF from earlier
|
2467
|
655
|
2463
|
656 * F$Move the bytes (seems to work)
|
|
657 os9 F$Move
|
|
658
|
2467
|
659 else
|
|
660 endc
|
|
661
|
2463
|
662 * assume everything worked (not good)
|
|
663 clrb
|
|
664
|
2466
|
665 puls x,y,u,pc
|
2463
|
666
|
2445
|
667
|
|
668 * SS.FDInf -
|
|
669 * Entry: A = path
|
|
670 * B = SS.FDInf
|
|
671 * X = ptr to 256 byte buffer
|
|
672 * Y = msb - Length of read
|
|
673 * lsb - MSB of LSN
|
|
674 * U = LSW of LSN
|
|
675 GstFDInf
|
|
676 rts
|
|
677
|
|
678
|
|
679
|
2461
|
680 ******************************
|
2445
|
681 *
|
2461
|
682 * SetStat - change status of file on the remote device
|
2445
|
683 *
|
2461
|
684 * Entry: Y = Path descriptor pointer
|
|
685 * U = Callers register stack pointer
|
2445
|
686 *
|
2461
|
687 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
688 * B = error code (if CC.Carry == 1)
|
2445
|
689 *
|
2450
|
690 setstt
|
|
691 lda #DW.setstt
|
2445
|
692 lbsr sendit
|
|
693
|
|
694 ldb R$B,u
|
|
695 beq SstOpt
|
|
696 cmpb #SS.Size
|
|
697 beq SstSize
|
|
698 cmpb #SS.FD
|
|
699 beq SstFD
|
|
700 cmpb #SS.Lock
|
|
701 beq SstLock
|
|
702 cmpb #SS.RsBit
|
|
703 beq SstRsBit
|
|
704 cmpb #SS.Attr
|
|
705 beq SstAttr
|
|
706 cmpb #SS.FSig
|
|
707 beq SstFSig
|
|
708 comb
|
|
709 ldb #E$UnkSvc
|
|
710 rts
|
|
711
|
|
712 SstOpt
|
|
713 SstSize
|
2466
|
714 rts
|
|
715
|
|
716 * Entry: A = path
|
|
717 * B = SS.FD
|
|
718 * X = ptr to 256 byte buffer
|
|
719 * Y = # of bytes of FD to write
|
|
720
|
|
721 * path # and SS.FD already sent to server, so
|
|
722 * send Y, recv Y bytes, get them into caller at X
|
|
723 * Y and U here are still as at entry
|
|
724 SstFD
|
|
725 ldx PD.DEV,y
|
|
726 ldx V$STAT,x
|
|
727 pshs x,y,u
|
|
728
|
|
729 * send caller's Y (do we really need this to be 16bit? X points to 256byte buff?
|
|
730 ldx R$Y,u
|
|
731 pshs x
|
|
732 leax ,s
|
|
733 ldy #2
|
|
734
|
|
735 * set U to dwsub
|
|
736 ifgt Level-1
|
|
737 ldu <D.DWSubAddr
|
|
738 else
|
|
739 ldu >D.DWSubAddr
|
|
740 endc
|
|
741 jsr 6,u
|
|
742
|
2467
|
743 ifgt Level-1
|
|
744 * move caller bytes into v.buf
|
2466
|
745
|
|
746 puls y ; get number of bytes pushed earlier
|
|
747 ldx 4,s
|
|
748 ldx R$X,x ; U = caller's X = dest ptr
|
|
749 ldu ,s
|
|
750 ldu V.BUF,u
|
|
751
|
|
752 ldx <D.Proc get calling proc desc
|
|
753 lda P$Task,x ; A = callers task #
|
|
754
|
|
755 ldb <D.SysTsk ; B = system task #
|
|
756
|
|
757
|
|
758 * F$Move the bytes (seems to work)
|
|
759 os9 F$Move
|
2467
|
760
|
2466
|
761 * write bytes from v.buf
|
|
762 tfr u,x
|
|
763
|
|
764 ifgt Level-1
|
|
765 ldu <D.DWSubAddr
|
|
766 else
|
|
767 ldu >D.DWSubAddr
|
|
768 endc
|
2467
|
769
|
|
770 else
|
|
771 puls y
|
|
772 ldx 4,s
|
|
773 ldx R$X,x
|
|
774 endc
|
|
775
|
2466
|
776
|
2467
|
777 jsr 6,u
|
2466
|
778
|
|
779 * assume everything worked (not good)
|
|
780 clrb
|
|
781
|
|
782 puls x,y,u,pc
|
|
783
|
|
784
|
2445
|
785 SstLock
|
|
786 SstRsBit
|
|
787 SstAttr
|
|
788 SstFSig
|
|
789 rts
|
|
790
|
|
791
|
2461
|
792 ******************************
|
|
793 *
|
|
794 * Close - close path to file on the remote device
|
|
795 *
|
|
796 * Entry: Y = Path descriptor pointer
|
|
797 * U = Callers register stack pointer
|
|
798 *
|
|
799 * Exit: CC.Carry = 0 (no error), 1 (error)
|
|
800 * B = error code (if CC.Carry == 1)
|
|
801 *
|
2450
|
802 close
|
|
803 pshs y,u
|
2445
|
804
|
|
805 * put path # on stack
|
2450
|
806 lda PD.PD,y
|
2445
|
807 pshs a
|
|
808
|
|
809 * put rfm op and DW op on stack
|
|
810 ldb #DW.close
|
|
811 lda #OP_VFM
|
|
812 pshs d
|
|
813
|
|
814 leax ,s ; point X to stack
|
|
815 ldy #3 ; 3 bytes to send
|
|
816 ifgt Level-1
|
|
817 ldu <D.DWSubAddr
|
|
818 else
|
|
819 ldu >D.DWSubAddr
|
|
820 endc
|
|
821
|
|
822 jsr 6,u
|
|
823 leas 2,s ;clean stack (leave 1 byte)
|
|
824
|
|
825 * read server response
|
|
826 leax ,s
|
|
827 ldy #1
|
|
828 jsr 3,u
|
|
829
|
|
830 * free system mem
|
|
831 ldd #256
|
|
832 ldx 1,s ; orig Y
|
|
833 ldx PD.DEV,x
|
2454
|
834 ldx V$STAT,x
|
2445
|
835 ldu V.BUF,x
|
|
836 os9 F$SRtMem
|
|
837
|
2450
|
838 puls b ; server sends result code
|
|
839 tstb
|
2445
|
840 beq close1
|
2450
|
841 coma ; set error flag if != 0
|
|
842 close1 puls u,y,pc
|
2445
|
843
|
|
844
|
2460
|
845 * send dwop, rfmop, path, set/getstat op (path is in A)
|
|
846 sendgstt pshs x,y,u
|
|
847
|
|
848 ldb R$B,u
|
|
849 pshs d
|
|
850
|
|
851 lda #OP_VFM ; load command
|
|
852 ldb #DW.getstt
|
|
853 pshs d ; command store on stack
|
|
854 leax ,s ; point X to stack
|
|
855 ldy #4 ; 2 byte to send
|
|
856 ifgt Level-1
|
|
857 ldu <D.DWSubAddr
|
|
858 else
|
|
859 ldu >D.DWSubAddr
|
|
860 endc
|
|
861
|
|
862 jsr 6,u
|
|
863 leas 4,s ;clean stack
|
|
864
|
|
865 clrb
|
|
866 puls x,y,u,pc
|
|
867
|
|
868
|
|
869
|
|
870
|
|
871
|
2435
|
872 * just send OP_VMF + vfmop
|
2446
|
873 sendit pshs a,x,y,u
|
2435
|
874
|
2445
|
875 lda #OP_VFM ; load command
|
|
876 pshs a ; command store on stack
|
|
877 leax ,s ; point X to stack
|
|
878 ldy #2 ; 2 byte to send
|
|
879 ifgt Level-1
|
|
880 ldu <D.DWSubAddr
|
|
881 else
|
|
882 ldu >D.DWSubAddr
|
|
883 endc
|
2435
|
884
|
2445
|
885 jsr 6,u
|
|
886 leas 2,s ;clean stack
|
|
887
|
|
888 clrb
|
2446
|
889 puls x,y,u,pc
|
2445
|
890
|
|
891 emod
|
|
892 eom equ *
|
|
893 end
|
|
894
|