SHELL

Header for : Shell
Module size: $4FA  #1274
Module CRC : $59ECC8 (Good)
Hdr parity : $D6
Exec. off  : $003D  #61
Data size  : $02B5  #693
Edition    : $14  #20
Ty/La At/Rv: $11 $81
Prog mod, 6809 Obj, re-ent, R/O

CODE

* Disassembly by Os9disasm of shell

 mod L04fa,L000d,$11,$81,L003d,D02b5

* OS-9 system function equates

F$Link equ $00
F$Load equ $01
F$UnLink equ $02
F$Fork equ $03
F$Wait equ $04
F$Chain equ $05
F$Exit equ $06
F$Send equ $08
F$Icpt equ $09
F$Sleep equ $0a
F$SPrior equ $0d
F$PErr equ $0f
F$PrsNam equ $10
I$Dup equ $82
I$Create equ $83
I$Open equ $84
I$ChgDir equ $86
I$Read equ $89
I$ReadLn equ $8b
I$WritLn equ $8c
I$Close equ $8f

* class D external label equates

Dffff equ $ffff

* OS9 data area definitions

D0000 rmb 1
D0001 rmb 1
D0002 rmb 1
D0003 rmb 1
D0004 rmb 1
D0005 rmb 1
D0006 rmb 2
D0008 rmb 2
D000a rmb 2
D000c rmb 1
D000d rmb 1
D000e rmb 1
D000f rmb 1
D0010 rmb 1
D0011 rmb 1
D0012 rmb 15
D0021 rmb 5
D0026 rmb 2
D0028 rmb 5
D002d rmb 7
D0034 rmb 15
D0043 rmb 8
D004b rmb 19
D005e rmb 47
D008d rmb 46
D00bb rmb 506
D02b5 equ .

L000d comb  
 asl   5,s
 inc   <L0027,pcr
L0013 sync  
 negb  
 fcb $61
 com   $6361
 inc   [,--u]
 bcs   L006f
 fcb $75
 jmp   ,--u
 bhi   L0074
 fcb $75
 jmp   ,-u
 neg   D0000
L0027 neg   D0000
 neg   D0000
 neg   D0000
 neg   D000a
L002e equ *-1
 comb  
 asl   5,s
 inc   12,s
 tst   D000a
L0035 equ *-1
L0036 clra  
 comb  
 rts   
 abx   
L003a stb   D000e
 rti   
L003d leas  -5,s
 pshs  d,x,y
 ldb   #$24
 lbsr  L00c9
 leax  <L003a,pcr
 os9 F$Icpt
 puls  d,x
 std   D0006
 beq   L005b
 lbsr  L0131
 bcs   L00bc
 tst   D000c
 bne   L00bb
L005b lds   ,s++
 leax  <L002e,pcr
 tst   D000f
 bne   L0074
 bsr   L00bf
L0067 leax  <L0035,pcr
 ldy   #5
L006e tst   D000f
L006f equ *-1
 bne   L0074
 bsr   L00c3
L0074 clra  
 leax  37,u
 ldy   #$00c8
 os9 I$ReadLn
 bcc   L008e
 cmpb  #$d3
 beq   L00b2
L0085 tst   D0011
 bne   L00bc
 os9 F$PErr
 bra   L0067
L008e cmpy  #1
 bhi   L009e
 leax  >L0036,pcr
 ldy   #4
 bra   L006e
L009e tst   D0010
 beq   L00a4
 bsr   L00bf
L00a4 lbsr  L0131
 bcc   L0067
 tstb  
 bne   L0085
 bra   L0067
L00ae fcb $65
 clr   6,s
 tst   D000d
L00b2 equ *-1
 clr   D0026
 fcb $05
 leax  <L00ae,pcr
 bsr   L00bf
L00bb clrb  
L00bc os9 F$Exit
L00bf ldy   #$0050
L00c3 lda   #2
 os9 I$WritLn
 rts   
L00c9 clr   b,u
L00cb decb  
 bpl   L00c9
 rts   
L00cf fcb $01
 sta   $aa02
 adca  #$d7
 fcb $01
 subd  D0043
 asla  
 andb  #1
 ora   #$43
 asla  
 eorb  D0001
 clrb  
 fcb $45
 eorb  D0003
 adcb  D004b
 rola  
 inca  
 ldd   #$0195
 eorb  D0001
 lda   D002d
 eorb  D0001
 jmp   -12287
 jmp   $2dd0
 fcb $01
 clr   -11263
 suba  #$2d
 andb  D0003
 orb   -13,u
 fcb $45
 lsrb  
 negb  
 sbcb  D0001
 lsr   D00bb
 neg   D0000
L010a com   D005e
 cmpa  2,x
 beq   L00cb
 fcb $02
 mul   
 lda   2,x
 orcc  #$8d
L0116 fcb $01
 eora  16062
 fcb $01
 stx   [<L011f,pcr]
 eora  -16895
L011f equ *-2
 stu   ,--y
 neg   D0000
L0125 tst   D0028
 bvs   L0128
L0128 equ *-1
L0129 tst   D0021
 bls   L0153
 rti   
 cwai  #$3e
 stu   $c60e
L0131 equ *-2
 bsr   L00c9
L0135 clr   D0003
 clr   D000e
 leay  <L00cf,pcr
 lbsr  L01c3
 bcs   L0192
 cmpa  #$0d
 beq   L0192
 sta   D000c
 cmpa  #$28
 bne   L016f
 leay  L000d,pcr
 sty   D0004
 leax  1,x
L0153 equ *-1
 stx   D0008
L0156 inc   D000d
L0158 leay  <L0125,pcr
 bsr   L01db
 cmpa  #$28
 beq   L0156
 cmpa  #$29
 bne   L018a
 dec   D000d
 bne   L0158
 lda   #$0d
 sta   -1,x
 bra   L0173
L016f bsr   L0195
 bcs   L0192
L0173 leay  <L0129,pcr
 bsr   L01db
 tfr   x,d
 subd  D0008
 std   D0006
 leax  -1,x
 leay  <L010a,pcr
 bsr   L01c3
 bcs   L0192
 ldy   D0004
L018a lbne  L02be
 cmpa  #$0d
 bne   L0135
L0192 lbra  L028f
L0195 stx   D0004
 bsr   L01a8
 bcs   L01a7
L019b bsr   L01a8
 bcc   L019b
 leay  L0116,pcr
 bsr   L01c3
 stx   D0008
L01a7 rts   
L01a8 os9 F$PrsNam
 bcc   L01b9
 lda   ,x+
 cmpa  #$2e
 bne   L01bd
 cmpa  ,x+
 beq   L01bb
 leay  -1,x
L01b9 leax  ,y
L01bb clra  
 rts   
L01bd comb  
 leax  -1,x
 ldb   #$d7
 rts   
L01c3 bsr   L01e9
 pshs  y
 bsr   L020c
 bcs   L01d4
 ldd   ,y
 jsr   d,y
 puls  y
 bcc   L01c3
 rts   
L01d4 clra  
 lda   ,x
 puls  y,pc
L01d9 puls  y
L01db pshs  y
 lda   ,x+
L01df tst   ,y
 bmi   L01d9
 cmpa  ,y+
 bne   L01df
 puls  y,pc
L01e9 pshs  x
 lda   ,x+
 cmpa  #$20
 beq   L01ff
 cmpa  #$2c
 beq   L01ff
 leax  L0129,pcr
L01f9 cmpa  ,x+
 bhi   L01f9
 puls  x,pc
L01ff leas  2,s
 lda   #$20
L0203 cmpa  ,x+
 beq   L0203
 leax  -1,x
 andcc #254
 rts   
L020c pshs  x,y
 leay  D0002,y
L0210 ldx   ,s
L0212 lda   ,x+
 cmpa  #$61
 bcs   L021a
 suba  #$20
L021a eora  ,y+
 asla  
 bne   L022e
 bcc   L0212
 lda   Dffff,y
 cmpa  #$c1
 bcs   L022b
 bsr   L01e9
 bcs   L022e
L022b clra  
 puls  d,y,pc
L022e leay  Dffff,y
L0230 lda   ,y+
 bpl   L0230
 sty   2,s
 ldd   ,y++
 bne   L0210
 comb  
 puls  x,y,pc
 lbsr  L0195
 clra  
 bsr   L0260
 bsr   L025f
 bsr   L025f
 bsr   L0286
 leax  1,x
 tfr   x,d
 subd  D0008
 std   D0006
 leas  255,u
 lbsr  L0394
 os9 F$Chain
 os9 F$Exit
L025f inca  
L0260 pshs  a
 bra   L02ab
 lda   #$84
 bra   L026a
 lda   #$83
L026a os9 I$ChgDir
 rts   
 clra  
 bra   L0273
 lda   #1
L0273 sta   D000f
 rts   
 lda   #1
 bra   L027b
 clra  
L027b sta   D0010
 rts   
 lda   #1
 bra   L0283
 clra  
L0283 sta   D0011
 rts   
L0286 lda   #$0d
L0288 cmpa  ,x+
 bne   L0288
 cmpa  ,-x
 rts   
L028f pshs  cc,d
 clra  
L0292 bsr   L029d
 inca  
 cmpa  #2
 bls   L0292
 ror   ,s+
 puls  d,pc
L029d pshs  a
 tst   a,u
 beq   L02b6
 os9 I$Close
 lda   a,u
 os9 I$Dup
L02ab ldb   ,s
 lda   b,u
 beq   L02b6
 clr   b,u
 os9 I$Close
L02b6 puls  a,pc
L02b8 asrb  
 asla  
 fcb $41
 lsrb  
 swi   
 tst   D008d
L02be equ *-1
 fcb $cf
 leax  <L02b8,pcr
 lbsr  L00bf
 clrb  
 coma  
 rts   
L02c9 ldd   #1
 bra   L02e3
 ldd   #$020d
 stb   -2,x
 bra   L02d7
 lda   #1
L02d7 ldb   #2
 bra   L02e3
L02db tst   a,u
 bne   L02be
 pshs  d
 bra   L02ed
L02e3 tst   a,u
 bne   L02be
 pshs  d
 ldb   #$0d
 stb   -1,x
L02ed os9 I$Dup
 bcs   L030d
 ldb   ,s
 sta   b,u
 lda   ,s
 os9 I$Close
 lda   1,s
 bita  #2
 bne   L0306
 os9 I$Open
 bra   L030b
L0306 ldb   #$0b
 os9 I$Create
L030b stb   1,s
L030d puls  d,pc
 ldb   #$0d
 stb   -1,x
 ldb   D0003
 bne   L02be
 lbsr  L04ca
 eora  #$4b
 anda  #$df
 bne   L0328
 leax  1,x
 lda   #4
 mul   
 tsta  
 bne   L02be
L0328 stb   D0003
 lbra  L01e9
 leax  -1,x
 lbsr  L03c7
 bra   L0337
 lbsr  L03c3
L0337 bcs   L034a
 lbsr  L028f
 bsr   L035c
L033e bcs   L034a
 lbsr  L01e9
 cmpa  #$0d
 bne   L0349
 leas  4,s
L0349 clrb  
L034a lbra  L028f
 lbsr  L03c3
 bcs   L034a
 bsr   L034a
 ldb   #$26
 lbsr  L0495
 bra   L033e
 clra  
L035c pshs  a
L035e os9 F$Wait
 tst   D000e
 beq   L0376
 ldb   D000e
 cmpb  #2
 bne   L038e
 lda   ,s
 beq   L038e
 os9 F$Send
 clr   ,s
 bra   L035e
L0376 bcs   L0392
 cmpa  ,s
 beq   L038e
 tst   ,s
 beq   L0383
 tstb  
 beq   L035e
L0383 pshs  b
 bsr   L034a
 ldb   #$2d
 lbsr  L0495
 puls  b
L038e tstb  
 beq   L0392
 coma  
L0392 puls  a,pc
L0394 lda   #$11
 ldb   D0003
 ldx   D0004
 ldy   D0006
 ldu   D0008
 rts   
L03a0 lda   #4
 os9 I$Open
 bcs   L03fe
 leax  19,u
 ldy   #$000d
 os9 I$Read
 pshs  cc,b
 os9 I$Close
 puls  cc,b
 lblo  L045f
 lda   6,x
 ldy   11,x
 bra   L03d7
L03c3 lda   #$0d
 sta   -1,x
L03c7 pshs  x,y,u
 clra  
 ldx   D0004
 os9 F$Link
 bcs   L03a0
 ldy   11,u
 os9 F$UnLink
L03d7 cmpa  #$11
 beq   L0425
 sty   D000a
 leax  L0013,pcr
L03e2 tst   ,x
 beq   L045d
 cmpa  ,x+
 beq   L03f0
L03ea tst   ,x+
 bpl   L03ea
 bra   L03e2
L03f0 ldd   D0008
 subd  D0004
 addd  D0006
 std   D0006
 ldd   D0004
 std   D0008
 bra   L0423
L03fe ldx   D0006
 leax  5,x
 stx   D0006
 ldx   D0004
 ldu   4,s
 lbsr  L02c9
 bcs   L045f
 ldu   D0008
 ldd   #22560
 std   ,--u
 ldd   #20512
 std   ,--u
 ldb   #$2d
 stb   ,-u
 stu   D0008
 leax  L000d,pcr
L0423 stx   D0004
L0425 ldx   D0004
 lda   #$11
 os9 F$Link
 bcc   L0433
 os9 F$Load
 bcs   L045f
L0433 pshs  u
 tst   D0003
 bne   L0442
 ldd   11,u
 addd  D000a
 addd  #$00ff
 sta   D0003
L0442 lbsr  L0394
 os9 F$Fork
 puls  u
 pshs  cc,b
 bcs   L0454
 ldx   #1
 os9 F$Sleep
L0454 clr   D0004
 clr   D0005
 os9 F$UnLink
 puls  cc,b,x,y,u,pc
L045d ldb   #$ea
L045f coma  
 puls  x,y,u,pc
L0462 ble   L04d4
 rol   -16,s
 fcb $65
 tst   D0034
 fcb $10
 leax  <L0462,pcr
 ldd   #$0103
 lbsr  L02db
 puls  x
 bcs   L04c9
 lbsr  L03c3
 bcs   L04c9
 lda   ,u
 bne   L0487
 os9 I$Dup
 bcs   L04c9
 sta   ,u
L0487 clra  
 os9 I$Close
 lda   #1
 os9 I$Dup
 lda   #1
 lbra  L029d
L0495 pshs  d,x,y
 pshs  b,x,y
 leax  1,s
 ldb   #$2f
L049d incb  
 suba  #$64
 bcc   L049d
 stb   ,x+
 ldb   #$3a
L04a6 decb  
 adda  #$0a
 bcc   L04a6
 stb   ,x+
 adda  #$30
 ldb   #$0d
 std   ,x
 leax  ,s
 lbsr  L00bf
 leas  5,s
 puls  d,x,y,pc
 bsr   L04ca
 cmpb  #2
 bcs   L04e5
 tfr   b,a
 ldb   #0
 os9 F$Send
L04c9 rts   
L04ca clrb  
L04cb lda   ,x+
 suba  #$30
 cmpa  #9
 bhi   L04dc
 pshs  a
L04d4 equ *-1
 lda   #$0a
 mul   
 addb  ,s+
 bcc   L04cb
L04dc lda   ,-x
 bcs   L04e3
 tstb  
 bne   L04c9
L04e3 leas  2,s
L04e5 lbra  L02be
 bsr   L04ca
 stb   D0012
 lbsr  L01e9
 bsr   L04ca
 lda   D0012
 os9 F$SPrior
 rts   

 emod 

L04fa equ *

 end

RTS

Return to OS-9 or Top

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies