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