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