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