Mercurial > hg > Members > kono > nitros9-code
comparison level1/modules/rfm.asm @ 2441:d701ee4e0732
RFM again
author | aaronwolfe |
---|---|
date | Thu, 25 Feb 2010 05:24:23 +0000 |
parents | d5ba9175a498 |
children | 8f5daacfb035 |
comparison
equal
deleted
inserted
replaced
2440:d5ba9175a498 | 2441:d701ee4e0732 |
---|---|
133 lbra sendit | 133 lbra sendit |
134 delete lda #DW.delete | 134 delete lda #DW.delete |
135 lbra sendit | 135 lbra sendit |
136 seek lda #DW.seek | 136 seek lda #DW.seek |
137 lbra sendit | 137 lbra sendit |
138 read lda #DW.read | 138 |
139 lbra sendit | 139 read pshs u |
140 | |
141 * put path # on stack | |
142 lda ,y | |
143 pshs a | |
144 | |
145 * put rfm op and DW op on stack | |
146 ldb #DW.read | |
147 bra read1 | |
148 | |
140 write lda #DW.write | 149 write lda #DW.write |
141 lbra sendit | 150 lbra sendit |
142 | 151 |
143 readln pshs u | 152 readln pshs u |
144 | 153 |
146 lda ,y | 155 lda ,y |
147 pshs a | 156 pshs a |
148 | 157 |
149 * put rfm op and DW op on stack | 158 * put rfm op and DW op on stack |
150 ldb #DW.readln | 159 ldb #DW.readln |
151 lda #OP_VFM | 160 read1 lda #OP_VFM |
152 pshs d | 161 pshs d |
153 | 162 |
154 leax ,s ; point X to stack | 163 leax ,s ; point X to stack |
155 ldy #3 ; 3 bytes to send | 164 ldy #3 ; 3 bytes to send |
156 ifgt Level-1 | 165 ifgt Level-1 |
179 | 188 |
180 ldb ,s | 189 ldb ,s |
181 beq readln1 ; 0 bytes = EOF | 190 beq readln1 ; 0 bytes = EOF |
182 | 191 |
183 * read the data from server if > 0 | 192 * read the data from server if > 0 |
184 leas -b,s ; doesnt work | 193 tfr b,a |
185 pshs b | 194 comb |
195 incb | |
196 leas b,s ; reserve room on stack | |
197 pshs a ; save count | |
186 leax 1,s | 198 leax 1,s |
187 clra | 199 clra |
188 tfr d,y | 200 tfr d,y |
189 jsr 6,u | 201 jsr 3,u |
190 | 202 |
191 puls a | 203 |
192 | 204 * F$Move |
193 ldx <D.Proc get curr proc desc | 205 * a = my task # |
194 ldb P$Task,x get task # | 206 * b = caller's task # |
195 | 207 * X = source ptr |
196 inca | 208 * Y = byte count |
197 ldx a,s ;pointer to caller's stack is on our stack, behind the data and one byte | 209 * U = dest ptr |
198 deca | 210 |
199 ldx R$X,x ; should be X from caller | 211 puls b |
200 | 212 clra |
201 * ok.. now data is on stack, data size in A, caller's task in B, addr in caller to put it at is in X | 213 tfr d,y ; y= byte count (was set in dwsub call, not sure if preserved) |
202 * get it into calling proc with F$STABX? | 214 |
203 | 215 incb |
204 | 216 ldx b,s ;pointer to caller's stack is on our stack, behind the data and one byte |
205 | 217 ldu R$X,x ; U = caller's X = dest ptr |
206 | 218 |
207 clrb | 219 lda <D.SysTsk ; A = system task # (??) |
208 bra readln2 | 220 |
221 ldx <D.Proc get calling proc desc | |
222 ldb P$Task,x ; B = callers task # | |
223 | |
224 leax ,s ; x = src ptr | |
225 | |
226 * try this F$Move | |
227 os9 F$Move | |
228 | |
229 * cleanup | |
230 tfr y,d | |
231 leas b,s | |
232 | |
233 clrb | |
234 bra readln2 | |
209 | 235 |
210 readln1 orcc #1 | 236 readln1 orcc #1 |
211 ldb #211 | 237 ldb #E$EOF |
212 readln2 leas 1,s | 238 readln2 leas 1,s |
213 puls u | 239 puls u |
214 rts | 240 rts |
215 | 241 |
216 | 242 |