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