Mercurial > hg > Members > kono > nitros9-code
annotate level2/cmds/shell_21.asm @ 1099:b77631456f91
Change to makefile
author | roug |
---|---|
date | Wed, 09 Apr 2003 19:02:19 +0000 |
parents | cd215e8dce44 |
children | bf6f854a4299 |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * Shell - OS-9 command line interpreter | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
8 * 21 Original Tandy/Microware version |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
9 * 21r2 CHD no longer sets WRITE. permission BGP 03/01/22 |
0 | 10 |
11 nam Shell | |
12 ttl OS-9 command line interpreter | |
13 | |
14 * Disassembled 99/04/18 22:59:49 by Disasm v1.6 (C) 1988 by RML | |
15 | |
16 ifp1 | |
17 use defsfile | |
18 endc | |
19 | |
20 tylg set Prgrm+Objct | |
21 atrv set ReEnt+rev | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
22 rev set $02 |
0 | 23 edition set 21 |
24 | |
25 mod eom,name,tylg,atrv,start,size | |
26 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
27 org 0 |
0 | 28 u0000 rmb 1 |
29 u0001 rmb 2 | |
30 u0003 rmb 1 | |
31 u0004 rmb 1 | |
32 u0005 rmb 1 | |
33 u0006 rmb 2 | |
34 u0008 rmb 1 | |
35 u0009 rmb 1 | |
36 u000A rmb 1 | |
37 u000B rmb 1 | |
38 u000C rmb 1 | |
39 u000D rmb 1 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
40 kbdsignl rmb 1 |
0 | 41 u000F rmb 1 |
42 u0010 rmb 1 | |
43 u0011 rmb 1 | |
44 u0012 rmb 1 | |
45 u0013 rmb 1 | |
46 u0014 rmb 1 | |
47 u0015 rmb 1 | |
48 u0016 rmb 1 | |
49 u0017 rmb 22 | |
50 u002D rmb 3 | |
51 u0030 rmb 14 | |
52 u003E rmb 32 | |
53 u005E rmb 2 | |
54 u0060 rmb 16 | |
55 u0070 rmb 58 | |
56 u00AA rmb 85 | |
57 u00FF rmb 513 | |
58 size equ . | |
59 name equ * | |
60 | |
61 L000D fcs /Shell/ | |
62 fcb edition | |
63 | |
64 L0013 fcb $13 | |
65 fcs "PascalS" | |
66 fcb $25 % | |
67 fcs "RunC" | |
68 fcb $22 " | |
69 fcs "RunB" | |
70 fcb $00 | |
71 fcb $00 | |
72 fcb $00 | |
73 fcb $00 | |
74 fcb $00 | |
75 fcb $00 | |
76 fcb $00 | |
77 fcb $00 | |
78 fcb $00 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
79 Intro fcb C$LF |
0 | 80 fcc "Shell" |
81 fcb C$CR | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
82 DefPrmpt fcb C$LF |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
83 OS9Prmpt fcc "OS9:" |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
84 OS9PrmL equ *-OS9Prmpt |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
85 DefPrmL equ *-DefPrmpt |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
86 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
87 IcptRtn stb <kbdsignl |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
88 rti |
0 | 89 |
90 start leas -$05,s | |
91 pshs y,x,b,a | |
92 ldb #$6F | |
93 lbsr L0175 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
94 leax <IcptRtn,pcr |
0 | 95 os9 F$Icpt |
96 puls x,b,a | |
97 std <u0006 | |
98 beq L005B | |
99 lbsr L017B | |
100 bcs L00C2 | |
101 tst <u000C | |
102 bne L00C1 | |
103 L005B lds ,s++ | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
104 L005E leax <Intro,pcr |
0 | 105 tst <u0012 |
106 bne L0076 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
107 bsr WriteLin |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
108 bcs Exit |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
109 L0069 leax <DefPrmpt,pcr |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
110 ldy #DefPrmL |
0 | 111 L0070 tst <u0012 |
112 bne L0076 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
113 bsr WritLin2 |
0 | 114 L0076 clra |
115 leax <u0070,u | |
116 ldy #$00C8 | |
117 os9 I$ReadLn | |
118 bcc L0094 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
119 cmpb #E$EOF |
0 | 120 beq L00B8 |
121 L0087 tst <u000F | |
122 bne L008F | |
123 tst <u0014 | |
124 bne L00C2 | |
125 L008F os9 F$PErr | |
126 bra L0069 | |
127 L0094 cmpy #$0001 | |
128 bhi L00A4 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
129 leax >OS9Prmpt,pcr |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
130 ldy #OS9PrmL |
0 | 131 bra L0070 |
132 L00A4 tst <u0013 | |
133 beq L00AA | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
134 bsr WriteLin |
0 | 135 L00AA lbsr L017B |
136 bcc L0069 | |
137 tstb | |
138 bne L0087 | |
139 bra L0069 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
140 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
141 eofmsg fcc "eof" |
0 | 142 fcb C$CR |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
143 |
0 | 144 L00B8 tst <u0012 |
145 bne L00C1 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
146 leax <eofmsg,pcr |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
147 bsr WriteLin |
0 | 148 L00C1 clrb |
149 L00C2 lda <u000F | |
150 lbne L0331 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
151 Exit os9 F$Exit |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
152 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
153 WriteLin ldy #80 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
154 WritLin2 lda #$02 stderr |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
155 os9 I$WritLn write line |
0 | 156 rts |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
157 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
158 * I=... |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
159 Immortal lbsr L03B3 |
0 | 160 lbcs L02ED |
161 pshs x | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
162 ldb #SS.DevNm |
0 | 163 leax <u0016,u |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
164 lda #PDELIM |
0 | 165 sta ,x+ |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
166 clra stdin |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
167 os9 I$GetStt get device name |
0 | 168 puls x |
169 lbcs L02ED | |
170 inc <u000F | |
171 inc <u0010 | |
172 lbsr L02ED | |
173 clr <u0010 | |
174 rts | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
175 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
176 L00FB fdb Comment-* |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
177 fcs "*" |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
178 fdb Wait-* |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
179 fcs "W" |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
180 fdb Chd-* |
0 | 181 fcs "CHD" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
182 fdb Chx-* |
0 | 183 fcs "CHX" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
184 fdb Ex-* |
0 | 185 fcs "EX" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
186 fdb Kill-* |
0 | 187 fcs "KILL" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
188 fdb X-* |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
189 fcs "X" |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
190 fdb NOX-* |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
191 fcs "-X" |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
192 fdb Prompt-* |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
193 fcs "P" |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
194 fdb NoPrompt-* |
0 | 195 fcs "-P" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
196 fdb Echo-* |
0 | 197 fcs "T" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
198 fdb NoEcho-* |
0 | 199 fcs "-T" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
200 fdb SetPr-* |
0 | 201 fcs "SETPR" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
202 fdb Immortal-* |
0 | 203 fcs "I=" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
204 fdb NextCmd-* |
0 | 205 fcs ";" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
206 fdb $0000 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
207 L013A fdb Pipe-* |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
208 fcs "!" |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
209 fdb NextCmd2-* |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
210 fcs ";" |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
211 fdb Backgrnd-* |
0 | 212 fcs "&" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
213 fdb Return-* |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
214 fcb $8D |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
215 L0146 fdb AllRedir-* |
0 | 216 fcs "<>>>" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
217 fdb InErrRedir-* |
0 | 218 fcs "<>>" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
219 fdb InOutRedir-* |
0 | 220 fcs "<>" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
221 fdb OutErrRedir-* |
0 | 222 fcs ">>>" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
223 fdb ErrRedir-* |
0 | 224 fcs ">>" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
225 fdb InRedir-* |
0 | 226 fcs "<" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
227 fdb OutRedir-* |
0 | 228 fcs ">" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
229 fdb StkSize-* |
0 | 230 fcs "#" |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
231 fdb $0000 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
232 |
0 | 233 L0169 fcb $0d |
234 fcc "()" | |
235 fcb $ff | |
236 L016D fcb $0d | |
237 fcc "!#&;<>" | |
238 fcb $ff | |
239 | |
240 L0175 clr b,u | |
241 decb | |
242 bpl L0175 | |
243 rts | |
244 L017B ldb #$0E | |
245 bsr L0175 | |
246 L017F clr <u0003 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
247 clr <kbdsignl |
0 | 248 leay >L00FB,pcr |
249 lbsr L020F | |
250 bcs L01DE | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
251 cmpa #C$CR |
0 | 252 beq L01DE |
253 sta <u000C | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
254 cmpa #'( |
0 | 255 bne L01BA |
256 leay >L000D,pcr | |
257 sty <u0004 | |
258 leax $01,x | |
259 stx <u0008 | |
260 L01A1 inc <u000D | |
261 L01A3 leay <L0169,pcr | |
262 bsr L0227 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
263 cmpa #'( |
0 | 264 beq L01A1 |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
265 cmpa #') |
0 | 266 bne L01D6 |
267 dec <u000D | |
268 bne L01A3 | |
269 lda #$0D | |
270 sta -$01,x | |
271 bra L01BE | |
272 L01BA bsr L01E1 | |
273 bcs L01DE | |
274 L01BE leay <L016D,pcr | |
275 bsr L0227 | |
276 tfr x,d | |
277 subd <u0008 | |
278 std <u0006 | |
279 leax -$01,x | |
280 leay >L013A,pcr | |
281 bsr L020F | |
282 bcs L01DE | |
283 ldy <u0004 | |
284 L01D6 lbne L0326 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
285 cmpa #C$CR |
0 | 286 bne L017F |
287 L01DE lbra L02ED | |
288 L01E1 stx <u0004 | |
289 bsr L01F4 | |
290 bcs L01F3 | |
291 L01E7 bsr L01F4 | |
292 bcc L01E7 | |
293 leay >L0146,pcr | |
294 bsr L020F | |
295 stx <u0008 | |
296 L01F3 rts | |
297 L01F4 os9 F$PrsNam | |
298 bcc L0205 | |
299 lda ,x+ | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
300 cmpa #C$PERD |
0 | 301 bne L0209 |
302 cmpa ,x+ | |
303 beq L0207 | |
304 leay -$01,x | |
305 L0205 leax ,y | |
306 L0207 clra | |
307 rts | |
308 L0209 comb | |
309 leax -$01,x | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
310 ldb #E$BPNAM |
0 | 311 rts |
312 L020F bsr L0241 | |
313 pshs y | |
314 bsr L0264 | |
315 bcs L0220 | |
316 ldd ,y | |
317 jsr d,y | |
318 puls y | |
319 bcc L020F | |
320 rts | |
321 L0220 clra | |
322 lda ,x | |
323 puls pc,y | |
324 L0225 puls y | |
325 L0227 pshs y | |
326 lda ,x+ | |
327 L022B tst ,y | |
328 bmi L0225 | |
329 cmpa #$22 | |
330 bne L023B | |
331 L0233 lda ,x+ | |
332 cmpa #$22 | |
333 bne L0233 | |
334 lda ,x+ | |
335 L023B cmpa ,y+ | |
336 bne L022B | |
337 puls pc,y | |
338 L0241 pshs x | |
339 lda ,x+ | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
340 cmpa #C$SPAC |
0 | 341 beq L0257 |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
342 cmpa #C$COMA |
0 | 343 beq L0257 |
344 leax >L016D,pcr | |
345 L0251 cmpa ,x+ | |
346 bhi L0251 | |
347 puls pc,x | |
348 L0257 leas $02,s | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
349 lda #C$SPAC |
0 | 350 L025B cmpa ,x+ |
351 beq L025B | |
352 leax -$01,x | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
353 NextCmd andcc #^Carry |
0 | 354 rts |
355 L0264 pshs y,x | |
356 leay $02,y | |
357 L0268 ldx ,s | |
358 L026A lda ,x+ | |
359 cmpa #$61 | |
360 bcs L0272 | |
361 suba #$20 | |
362 L0272 eora ,y+ | |
363 lsla | |
364 bne L0286 | |
365 bcc L026A | |
366 lda -$01,y | |
367 cmpa #$C1 | |
368 bcs L0283 | |
369 bsr L0241 | |
370 bcs L0286 | |
371 L0283 clra | |
372 puls pc,y,b,a | |
373 L0286 leay -$01,y | |
374 L0288 lda ,y+ | |
375 bpl L0288 | |
376 sty $02,s | |
377 ldd ,y++ | |
378 bne L0268 | |
379 comb | |
380 puls pc,y,x | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
381 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
382 Ex lbsr L01E1 |
0 | 383 clra |
384 bsr L02B8 | |
385 bsr L02B7 | |
386 bsr L02B7 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
387 bsr Comment |
0 | 388 leax $01,x |
389 tfr x,d | |
390 subd <u0008 | |
391 std <u0006 | |
392 leas >u00FF,u | |
393 lbsr L0497 | |
394 os9 F$Chain | |
395 lbra L00C2 | |
396 L02B7 inca | |
397 L02B8 pshs a | |
398 bra L0313 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
399 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
400 Chx lda #DIR.+EXEC. |
0 | 401 bra L02C2 |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
402 *Chd lda #DIR.+UPDAT. note write mode!! |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
403 * Removed WRITE. requirement above (some devices are read only) |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
404 Chd lda #DIR.+READ. note write mode!! |
0 | 405 L02C2 os9 I$ChgDir |
406 rts | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
407 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
408 Prompt clra |
0 | 409 bra L02CB |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
410 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
411 NoPrompt lda #$01 |
0 | 412 L02CB sta <u0012 |
413 rts | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
414 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
415 Echo lda #$01 |
0 | 416 bra L02D3 |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
417 NoEcho clra |
0 | 418 L02D3 sta <u0013 |
419 rts | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
420 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
421 X lda #$01 |
0 | 422 bra L02DB |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
423 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
424 NOX clra |
0 | 425 L02DB sta <u0014 |
426 rts | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
427 Comment lda #$0D |
0 | 428 L02E0 cmpa ,x+ |
429 bne L02E0 | |
430 cmpa ,-x | |
431 rts | |
432 L02E7 pshs b,a,cc | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
433 |
0 | 434 lda #$01 |
435 bra L02F1 | |
436 L02ED pshs b,a,cc | |
437 lda #$02 | |
438 L02F1 sta <u0011 | |
439 clra | |
440 L02F4 bsr L02FF | |
441 inca | |
442 cmpa <u0011 | |
443 bls L02F4 | |
444 ror ,s+ | |
445 puls pc,b,a | |
446 L02FF pshs a | |
447 tst <u0010 | |
448 bmi L031B | |
449 bne L0313 | |
450 tst a,u | |
451 beq L031E | |
452 os9 I$Close | |
453 lda a,u | |
454 os9 I$Dup | |
455 L0313 ldb ,s | |
456 lda b,u | |
457 beq L031E | |
458 clr b,u | |
459 L031B os9 I$Close | |
460 L031E puls pc,a | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
461 |
0 | 462 L0320 fcc "WHAT?" |
463 fcb C$CR | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
464 |
0 | 465 L0326 bsr L02ED |
466 leax <L0320,pcr | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
467 lbsr WriteLin |
0 | 468 clrb |
469 coma | |
470 rts | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
471 |
0 | 472 L0331 inc <u0010 |
473 bsr L02ED | |
474 lda #$FF | |
475 sta <u0010 | |
476 bsr L02E7 | |
477 leax <u0016,u | |
478 bsr L03BC | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
479 lbcs Exit |
0 | 480 lda #$02 |
481 bsr L02FF | |
482 lbsr L03DC | |
483 clr <u0010 | |
484 lbra L005E | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
485 InRedir ldd #$0001 |
0 | 486 bra L036E |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
487 ErrRedir ldd #$020D |
0 | 488 stb -$02,x |
489 bra L035E | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
490 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
491 OutRedir lda #$01 |
0 | 492 L035E ldb #$02 |
493 bra L036E | |
494 L0362 tst a,u | |
495 bne L0326 | |
496 pshs b,a | |
497 tst <u0010 | |
498 bmi L0386 | |
499 bra L0378 | |
500 L036E tst a,u | |
501 bne L0326 | |
502 pshs b,a | |
503 ldb #$0D | |
504 stb -$01,x | |
505 L0378 os9 I$Dup | |
506 bcs L03A8 | |
507 ldb ,s | |
508 sta b,u | |
509 lda ,s | |
510 os9 I$Close | |
511 L0386 lda $01,s | |
512 bmi L0391 | |
513 ldb ,s | |
514 bsr L03E1 | |
515 tsta | |
516 bpl L0398 | |
517 L0391 anda #$0F | |
518 os9 I$Dup | |
519 bra L03A6 | |
520 L0398 bita #$02 | |
521 bne L03A1 | |
522 os9 I$Open | |
523 bra L03A6 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
524 L03A1 ldb #PREAD.+READ.+WRITE. |
0 | 525 os9 I$Create |
526 L03A6 stb $01,s | |
527 L03A8 puls pc,b,a | |
528 L03AA clra | |
529 L03AB ldb #$03 | |
530 bra L0362 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
531 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
532 AllRedir lda #$0D |
0 | 533 L03B1 sta -$04,x |
534 L03B3 bsr L03BC | |
535 bcc L03DC | |
536 L03B7 rts | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
537 InOutRedir |
0 | 538 lda #$0D |
539 sta -$02,x | |
540 L03BC bsr L03AA | |
541 bcs L03B7 | |
542 ldd #$0180 | |
543 bra L0362 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
544 InErrRedir |
0 | 545 lda #$0D |
546 sta -$03,x | |
547 bsr L03AA | |
548 bcs L03B7 | |
549 ldd #$0280 | |
550 bra L0362 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
551 OutErrRedir |
0 | 552 lda #$0D |
553 sta -$03,x | |
554 lda #$01 | |
555 bsr L03AB | |
556 bcs L03B7 | |
557 L03DC ldd #$0281 | |
558 bra L0362 | |
559 L03E1 pshs x,b,a | |
560 ldd ,x++ | |
561 cmpd #$2F30 | |
562 bcs L040D | |
563 cmpd #$2F32 | |
564 bhi L040D | |
565 pshs x,b,a | |
566 lbsr L0241 | |
567 puls x,b,a | |
568 bcs L040D | |
569 andb #$03 | |
570 cmpb $01,s | |
571 bne L0404 | |
572 ldb $01,s | |
573 ldb b,u | |
574 L0404 orb #$80 | |
575 stb ,s | |
576 puls b,a | |
577 leas $02,s | |
578 rts | |
579 L040D puls pc,x,b,a | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
580 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
581 StkSize ldb #$0D |
0 | 582 stb -$01,x |
583 ldb <u0003 | |
584 lbne L0326 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
585 lbsr ASC2Int |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
586 eora #'K |
0 | 587 anda #$DF |
588 bne L042C | |
589 leax $01,x | |
590 lda #$04 | |
591 mul | |
592 tsta | |
593 lbne L0326 | |
594 L042C stb <u0003 | |
595 lbra L0241 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
596 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
597 Return leax -$01,x |
0 | 598 lbsr L04CA |
599 bra L043B | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
600 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
601 NextCmd2 lbsr L04C6 |
0 | 602 L043B bcs L044E |
603 lbsr L02ED | |
604 bsr L045F | |
605 L0442 bcs L044E | |
606 lbsr L0241 | |
607 cmpa #$0D | |
608 bne L044D | |
609 leas $04,s | |
610 L044D clrb | |
611 L044E lbra L02ED | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
612 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
613 Backgrnd bsr L04C6 |
0 | 614 bcs L044E |
615 bsr L044E | |
616 ldb #$26 | |
617 lbsr L0597 | |
618 bra L0442 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
619 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
620 Wait clra |
0 | 621 L045F pshs a |
622 L0461 os9 F$Wait | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
623 tst <kbdsignl |
0 | 624 beq L0479 |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
625 ldb <kbdsignl |
0 | 626 cmpb #$02 |
627 bne L0491 | |
628 lda ,s | |
629 beq L0491 | |
630 os9 F$Send | |
631 clr ,s | |
632 bra L0461 | |
633 L0479 bcs L0495 | |
634 cmpa ,s | |
635 beq L0491 | |
636 tst ,s | |
637 beq L0486 | |
638 tstb | |
639 beq L0461 | |
640 L0486 pshs b | |
641 bsr L044E | |
642 ldb #$2D | |
643 lbsr L0597 | |
644 puls b | |
645 L0491 tstb | |
646 beq L0495 | |
647 coma | |
648 L0495 puls pc,a | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
649 L0497 lda #Prgrm+Objct |
0 | 650 ldb <u0003 |
651 ldx <u0004 | |
652 ldy <u0006 | |
653 ldu <u0008 | |
654 rts | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
655 L04A3 lda #EXEC. |
0 | 656 os9 I$Open |
657 bcs L0500 | |
658 leax <u005E,u | |
659 ldy #$000D | |
660 os9 I$Read | |
661 pshs b,cc | |
662 os9 I$Close | |
663 puls b,cc | |
664 lbcs L0561 | |
665 lda $06,x | |
666 ldy $0B,x | |
667 bra L04D9 | |
668 L04C6 lda #$0D | |
669 sta -$01,x | |
670 L04CA pshs u,y,x | |
671 clra | |
672 ldx <u0004 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
673 IFGT Level-1 |
0 | 674 os9 F$NMLink |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
675 ELSE |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
676 os9 F$Link |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
677 ENDC |
0 | 678 bcs L04A3 |
679 ldx <u0004 | |
680 os9 F$UnLoad | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
681 L04D9 cmpa #Prgrm+Objct |
0 | 682 beq L0527 |
683 sty <u000A | |
684 leax >L0013,pcr | |
685 L04E4 tst ,x | |
686 beq L055F | |
687 cmpa ,x+ | |
688 beq L04F2 | |
689 L04EC tst ,x+ | |
690 bpl L04EC | |
691 bra L04E4 | |
692 L04F2 ldd <u0008 | |
693 subd <u0004 | |
694 addd <u0006 | |
695 std <u0006 | |
696 ldd <u0004 | |
697 std <u0008 | |
698 bra L0525 | |
699 L0500 ldx <u0006 | |
700 leax $05,x | |
701 stx <u0006 | |
702 ldx <u0004 | |
703 ldu $04,s | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
704 lbsr InRedir |
0 | 705 bcs L0561 |
706 ldu <u0008 | |
707 ldd #$5820 | |
708 std ,--u | |
709 ldd #$5020 | |
710 std ,--u | |
711 ldb #$2D | |
712 stb ,-u | |
713 stu <u0008 | |
714 leax >L000D,pcr | |
715 L0525 stx <u0004 | |
716 L0527 ldx <u0004 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
717 lda #Prgrm+Objct |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
718 IFGT Level-1 |
0 | 719 os9 F$NMLink |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
720 ELSE |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
721 os9 F$Link |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
722 ENDC |
0 | 723 bcc L0535 |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
724 IFGT Level-1 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
725 os9 F$NMLoad |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
726 ELSE |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
727 os9 F$Load |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
728 ENDC |
0 | 729 bcs L0561 |
730 L0535 tst <u0003 | |
731 bne L0542 | |
732 tfr y,d | |
733 addd <u000A | |
734 addd #$00FF | |
735 sta <u0003 | |
736 L0542 lbsr L0497 | |
737 os9 F$Fork | |
738 pshs b,a,cc | |
739 bcs L0552 | |
740 ldx #$0001 | |
741 os9 F$Sleep | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
742 L0552 lda #Prgrm+Objct |
0 | 743 ldx <u0004 |
744 clr <u0004 | |
745 clr <u0005 | |
746 os9 F$UnLoad | |
747 puls pc,u,y,x,b,a,cc | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
748 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
749 L055F ldb #E$NEMod |
0 | 750 L0561 coma |
751 puls pc,u,y,x | |
752 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
753 PipeName fcc "/pipe" |
0 | 754 fcb C$CR |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
755 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
756 Pipe pshs x |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
757 leax <PipeName,pcr |
0 | 758 ldd #$0103 |
759 lbsr L0362 | |
760 puls x | |
761 bcs L05CB | |
762 lbsr L04C6 | |
763 bcs L05CB | |
764 lda ,u | |
765 bne L0589 | |
766 os9 I$Dup | |
767 bcs L05CB | |
768 sta ,u | |
769 L0589 clra | |
770 os9 I$Close | |
771 lda #$01 | |
772 os9 I$Dup | |
773 lda #$01 | |
774 lbra L02FF | |
775 L0597 pshs y,x,b,a | |
776 pshs y,x,b | |
777 leax $01,s | |
778 ldb #$2F | |
779 L059F incb | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
780 suba #100 |
0 | 781 bcc L059F |
782 stb ,x+ | |
783 ldb #$3A | |
784 L05A8 decb | |
785 adda #$0A | |
786 bcc L05A8 | |
787 stb ,x+ | |
788 adda #$30 | |
789 ldb #$0D | |
790 std ,x | |
791 leax ,s | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
792 lbsr WriteLin |
0 | 793 leas $05,s |
794 puls pc,y,x,b,a | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
795 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
796 * Kill a process |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
797 Kill bsr ASC2Int |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
798 cmpb #$02 compare against first user process ID |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
799 bls L05E7 if lower or same, |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
800 tfr b,a transfer process ID to A |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
801 ldb #S$Kill load B with kill signal |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
802 os9 F$Send and send to process in A |
0 | 803 L05CB rts |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
804 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
805 * Entry: X = ASCII representation of number |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
806 * Exit : B = decimal value of ASCII number |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
807 ASC2Int clrb |
0 | 808 L05CD lda ,x+ |
809 suba #$30 | |
810 cmpa #$09 | |
811 bhi L05DE | |
812 pshs a | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
813 lda #10 |
0 | 814 mul |
815 addb ,s+ | |
816 bcc L05CD | |
817 L05DE lda ,-x | |
818 bcs L05E5 | |
819 tstb | |
820 bne L05CB | |
821 L05E5 leas $02,s | |
822 L05E7 lbra L0326 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
823 |
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
824 SetPr bsr ASC2Int |
0 | 825 stb <u0015 |
826 lbsr L0241 | |
949
cd215e8dce44
Added comments and fixed jump tables, added code for possible integration
boisy
parents:
510
diff
changeset
|
827 bsr ASC2Int |
0 | 828 lda <u0015 |
829 os9 F$SPrior | |
830 rts | |
831 | |
832 emod | |
833 eom equ * | |
834 end |