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