* Disassembly by Os9disasm of debug
mod L0817,L000d,$11,$81,L033d,D0200
* OS-9 system function equates
F$Link equ $00
F$UnLink equ $02
F$Fork equ $03
F$Wait equ $04
F$Exit equ $06
F$Mem equ $07
F$Icpt equ $09
F$SSWI equ $0e
F$PErr equ $0f
I$ReadLn equ $8b
I$WritLn equ $8c
* class D external label equates
Dfff4 equ $fff4
Dfff8 equ $fff8
Dffff equ $ffff
* OS9 data area definitions
D0000 rmb 1
D0001 rmb 1
D0002 rmb 1
D0003 rmb 1
D0004 rmb 2
D0006 rmb 2
D0008 rmb 2
D000a rmb 2
D000c rmb 4
D0010 rmb 16
D0020 rmb 1
D0021 rmb 19
D0034 rmb 4
D0038 rmb 9
D0041 rmb 1
D0042 rmb 1
D0043 rmb 1
D0044 rmb 1
D0045 rmb 6
D004b rmb 5
D0050 rmb 1
D0051 rmb 2
D0053 rmb 2
D0055 rmb 3
D0058 rmb 1
D0059 rmb 6
D005f rmb 5
D0064 rmb 29
D0081 rmb 3
D0084 rmb 2
D0086 rmb 2
D0088 rmb 22
D009e rmb 9
D00a7 rmb 18
D00b9 rmb 47
D00e8 rmb 20
D00fc rmb 260
D0200 equ .
L000d lsr 5,s
fcb $62
fcb $75
stb 6,x
L0013 bsr L0021
bra L0019
L0017 bsr L0027
L0019 pshs a
lda #$20
sta ,x+
puls a,pc
L0021 exg a,b
bsr L0027
tfr a,b
L0027 pshs b
andb #$f0
lsrb
lsrb
lsrb
lsrb
bsr L0035
puls b
andb #$0f
L0035 cmpb #9
bls L003b
addb #7
L003b addb #$30
stb ,x+
rts
L0040 pshs b,y,u
leau <L0065,pcr
ldy #5
L0049 clr ,s
L004b subd ,u
bcs L0053
inc ,s
bra L004b
L0053 addd ,u++
pshs b
ldb 1,s
addb #$30
stb ,x+
puls b
leay Dffff,y
bne L0049
puls b,y,u,pc
L0065 beq L0077
com D00e8
neg D0064
neg D000a
neg D0001
L006f lbsr L0127
leax 1,x
cmpa #$23
beq L00ba
L0077 equ *-1
cmpa #$25
beq L00e0
cmpa #$24
beq L0082
leax -1,x
L0082 leas -4,s
bsr L00f7
L0086 bsr L00fe
bcc L00a0
cmpb #$41
lblo L0110
cmpb #$46
bls L009e
cmpb #$61
bcs L0110
cmpb #$66
bhi L0110
subb #$20
L009e subb #$37
L00a0 stb ,s
ldd 2,s
bita #$f0
bne L0123
lslb
rola
lslb
rola
lslb
rola
lslb
rola
addb ,s
adca #0
std 2,s
inc 1,s
bra L0086
L00ba leas -4,s
bsr L00f7
L00be bsr L00fe
bcs L0110
stb ,s
ldd 2,s
lslb
rola
std 2,s
lslb
rola
lslb
rola
bcs L0123
addd 2,s
bcs L0123
addb ,s
adca #0
bcs L0123
std 2,s
inc 1,s
bra L00be
L00e0 leas -4,s
bsr L00f7
L00e4 ldb ,x+
subb #$30
bcs L0110
lsrb
bne L0110
rol 3,s
rol 2,s
bcs L0123
inc 1,s
bra L00e4
L00f7 clra
clrb
std 2,s
std 4,s
rts
L00fe ldb ,x+
cmpb #$30
bcs L0108
cmpb #$39
bls L010b
L0108 orcc #1
rts
L010b subb #$30
andcc #254
rts
L0110 leax -1,x
tst 1,s
beq L011c
ldd 2,s
andcc #254
bra L0120
L011c orcc #4
L011e orcc #1
L0120 leas 4,s
rts
L0123 andcc #251
bra L011e
L0127 lda ,x+
cmpa #$20
beq L0127
leax -1,x
rts
L0130 pshs d,x
lda 3,s
mul
pshs d
lda 2,s
ldb 4,s
mul
pshs d
lda 4,s
ldb 7,s
bsr L0157
lda 5,s
ldb 6,s
bsr L0157
andcc #254
ldd 2,s
ldx ,s
beq L0154
orcc #1
L0154 leas 8,s
rts
L0157 mul
addd 3,s
std 3,s
bcc L0160
inc 2,s
L0160 rts
L0161 pshs d,x,y
ldd ,s
bne L016b
orcc #1
bra L018b
L016b ldd #$0010
stb 4,s
clrb
L0171 asl 3,s
rol 2,s
rolb
rola
subd ,s
bmi L017f
inc 3,s
bra L0181
L017f addd ,s
L0181 dec 4,s
bne L0171
tfr d,x
ldd 2,s
andcc #254
L018b leas 6,s
rts
L018e sta ,x+
L0190 lda ,y+
bne L018e
rts
L0195 pshs y,u
tfr s,u
bsr L01a7
andcc #254
puls y,u,pc
L019f tfr u,s
orcc #1
puls y,u,pc
L01a5 leax 1,x
L01a7 bsr L01c9
pshs d
L01ab bsr L021d
cmpa #$2d
bne L01b9
bsr L01c7
nega
negb
sbca #0
bra L01bf
L01b9 cmpa #$2b
bne L01c5
bsr L01c7
L01bf addd ,s
std ,s
bra L01ab
L01c5 puls d,pc
L01c7 leax 1,x
L01c9 bsr L01fd
pshs d
L01cd bsr L021d
cmpa #$2a
bne L01e2
bsr L01fb
pshs x
ldx 2,s
lbsr L0130
bcc L01f5
ldb #2
bra L019f
L01e2 cmpa #$2f
bne L01c5
bsr L01fb
pshs x
ldx 2,s
lbsr L0161
bcc L01f5
ldb #1
bra L019f
L01f5 puls x
std ,s
bra L01cd
L01fb leax 1,x
L01fd bsr L0222
pshs d
L0201 bsr L021d
cmpa #$26
bne L020f
bsr L0220
andb 1,s
anda ,s
bra L0219
L020f cmpa #$21
bne L01c5
bsr L0220
orb 1,s
ora ,s
L0219 std ,s
bra L0201
L021d lbra L0127
L0220 leax 1,x
L0222 bsr L021d
cmpa #$5e
bne L022e
bsr L0239
comb
coma
bra L0238
L022e cmpa #$2d
bne L023b
bsr L0239
nega
negb
sbca #0
L0238 rts
L0239 leax 1,x
L023b bsr L021d
cmpa #$28
bne L0250
lbsr L01a5
pshs d
bsr L021d
cmpa #$29
beq L0282
ldb D0004
bra L0265
L0250 cmpa #$5b
bne L026a
lbsr L01a5
tfr d,y
ldd ,y
pshs d
bsr L021d
cmpa #$5d
beq L0282
ldb #5
L0265 leas 2,s
L0267 lbra L019f
L026a cmpa #$3c
bne L0286
lbsr L01a5
tfr d,y
clra
ldb ,y
pshs d
bsr L021d
cmpa #$3e
beq L0282
ldb #6
bra L0265
L0282 leax 1,x
puls d,pc
L0286 cmpa #$2e
bne L028f
ldd D0000
leax 1,x
rts
L028f cmpa #$27
bne L0297
ldd ,x++
clra
rts
L0297 cmpa #$22
bne L02a0
leax 1,x
ldd ,x++
rts
L02a0 cmpa #$3a
bne L02b4
leax 1,x
bsr L02c3
bcs L0267
tsta
bmi L02b1
clra
ldb ,y
rts
L02b1 ldd ,y
L02b3 rts
L02b4 lbsr L006f
bcc L02b3
beq L02bf
ldb #3
bra L0267
L02bf ldb #0
bra L0267
L02c3 ldb #9
pshs b
ldd ,x
cmpd #29552
beq L02d5
cmpd #21328
bne L02e2
L02d5 leax 2,x
ldd #2
tfr dp,a
tfr d,y
lda #$80
bra L0314
L02e2 leay >L0322,pcr
L02e6 lda ,y
ldb D0001,y
bne L02f8
cmpa ,x
beq L0307
adda #$20
cmpa ,x
beq L0307
bra L0318
L02f8 cmpd ,x
beq L0305
addd #$2020
cmpd ,x
bne L0318
L0305 leax 1,x
L0307 leax 1,x
lda D0002,y
tfr a,b
andb #$0f
ldy D0002
leay b,y
L0314 andcc #254
puls b,pc
L0318 leay D0003,y
dec ,s
bne L02e6
orcc #1
puls b,pc
L0322 coma
coma
neg D0044
negb
com D0050
coma
ora #$41
neg D0001
fcb $42
neg D0002
lsra
neg D0081
lslb
neg D0084
rolb
neg D0086
fcb $55
neg D0088
L033d leas 512,u
leas -12,s
sts D0002
sts D0004
leay L0765,pcr
sty 10,s
lda #$80
sta ,s
tfr s,x
leax -325,x
stx D0006
leax -80,x
stx D0008
leax -36,x
stx D000c
clr D0000
clr D0001
L036a clr ,x+
cmpx D0006
bcs L036a
leax L0652,pcr
lda #1
os9 F$SSWI
os9 F$Icpt
lbsr L07e1
ldx D0006
leay L0766,pcr
bsr L03c2
lbsr L07e3
L038a leay L077b,pcr
lbsr L07ef
lbsr L0807
leay L07ad,pcr
lda ,x
cmpa #$61
bcs L03a2
suba #$20
sta ,x
L03a2 leay D0003,y
lda ,y
beq L03b8
cmpa ,x
bne L03a2
leax 1,x
ldd D0001,y
leau L0000,pcr
jsr d,u
bra L038a
L03b8 ldb #9
bsr L03be
bra L038a
L03be os9 F$PErr
rts
L03c2 lbra L0190
lda ,x
cmpa #$2e
bne L03cf
ldd D000a
bra L03dc
L03cf cmpa #$0d
bne L03d7
L03d3 ldd D0000
bra L03dc
L03d7 lbsr L0195
bcs L03be
L03dc ldx D0000
stx D000a
std D0000
pshs d
bsr L0415
ldd ,s
lbsr L0013
puls y
ldb ,y
lbsr L0027
lbra L07e3
ldd D0000
subd #1
bra L03dc
bsr L043f
bcs L03be
ldx D0000
stb ,x
cmpb ,x
beq L040e
ldb #$0a
bsr L03be
bra L03d3
L040e ldd D0000
addd #1
bra L03dc
L0415 ldx D0006
pshs d
leay L0780,pcr
bsr L03c2
puls d,pc
lbsr L0195
bcs L03be
bsr L0415
pshs d
lda #$24
sta ,x+
lda ,s
lbsr L0013
lda #$23
sta ,x+
puls d
lbsr L0040
lbra L07e3
L043f lbsr L0195
bcs L044b
tsta
beq L044b
ldb #8
orcc #1
L044b rts
lbsr L0512
beq L04af
lbsr L02c3
lblo L03be
pshs a,y
lbsr L0512
bne L0475
bsr L0415
puls a,y
tsta
bpl L046d
ldd ,y
lbsr L0021
bra L0472
L046d ldb ,y
lbsr L0027
L0472 lbra L07e3
L0475 lda ,s+
bpl L0485
lbsr L0195
puls y
lblo L054e
std ,y
rts
L0485 bsr L043f
puls y
lblo L054e
stb ,y
rts
L0490 negb
coma
mul
neg D0041
mul
neg D0042
mul
neg D0043
coma
mul
neg D0044
negb
mul
neg D0053
negb
mul
neg D0058
mul
neg D0059
mul
neg D0055
mul
neg D0034
L04af equ *-1
nega
ldx D0006
leay <L0490,pcr
ldu D0002
lbsr L03c2
ldd 10,u
bsr L0505
lbsr L03c2
ldb 1,u
bsr L050f
lbsr L03c2
ldb 2,u
bsr L050f
lbsr L03c2
ldb ,u
bsr L050f
lbsr L03c2
ldb 3,u
bsr L050f
pshs y
lbsr L07e3
puls y
lbsr L03c2
tfr u,d
bsr L0505
lbsr L03c2
ldd 4,u
bsr L0505
lbsr L03c2
ldd 6,u
bsr L0505
lbsr L03c2
ldd 8,u
bsr L0505
lbsr L07e3
puls u,pc
ldd ,y++
L0505 lbra L0013
L0508 ldd ,y++
lbra L0021
ldb ,y+
L050f lbra L0017
L0512 lbsr L0127
cmpa #$0d
rts
bsr L0512
bne L0538
lbsr L0415
ldy D000c
ldb #$0c
pshs b
L0526 ldd ,y
beq L052d
lbsr L0013
L052d leay D0003,y
dec ,s
bne L0526
leas 1,s
lbra L07e3
L0538 lbsr L0195
bcs L054e
pshs d
bsr L0556
beq L0551
ldd #0
bsr L0556
beq L0551
ldb #$0b
leas 2,s
L054e lbra L03be
L0551 puls d
std ,y
rts
L0556 pshs u
tfr d,u
ldb #$0c
ldy D000c
L055f cmpu ,y
beq L056d
leay D0003,y
decb
bne L055f
ldb D000c
andcc #251
L056d puls u,pc
bsr L0512
beq L0581
lbsr L0195
bcs L054e
bsr L0556
bne L054e
clra
clrb
std ,y
rts
L0581 ldy D000c
ldb #$24
L0586 clr ,y+
decb
bne L0586
rts
bsr L0512
beq L059a
lbsr L0195
bcs L054e
ldy D0002
std D000a,y
L059a ldy D000c
ldb #$0c
ldx D0002
ldx 10,x
L05a3 ldu ,y
beq L05b3
lda ,u
sta D0002,y
cmpx ,y
beq L05b3
lda #$3f
sta ,u
L05b3 leay D0003,y
decb
bne L05a3
lds D0002
rti
bsr L0613
bcs L054e
orb #7
exg d,u
andb #248
pshs d,u
cmpd 2,s
bcc L05d9
L05cd ldy ,s
leay Dffff,y
cmpy 2,s
leay D0001,y
bcs L05db
L05d9 puls d,u,pc
L05db ldx D0006
tfr y,d
lbsr L0013
ldb #4
pshs b
L05e6 lbsr L0508
dec ,s
bne L05e6
lbsr L0019
ldb #8
stb ,s
ldy 1,s
L05f7 lda ,y+
cmpa #$7e
bhi L0601
cmpa #$20
bcc L0603
L0601 lda #$2e
L0603 sta ,x+
dec ,s
bne L05f7
leas 1,s
sty ,s
lbsr L07e3
bra L05cd
L0613 lbsr L0195
bcs L061d
tfr d,u
lbsr L0195
L061d rts
bsr L0613
lblo L03be
pshs d
L0626 cmpu ,s
bls L062d
puls d,pc
L062d ldd #$8008
sta ,u
L0632 cmpa ,u
bne L063e
lsra
lsr ,u
decb
bne L0632
bra L064e
L063e lbsr L0415
ldd #$2d20
std ,x++
tfr u,d
lbsr L0021
lbsr L07e3
L064e leau 1,u
bra L0626
L0652 clra
tfr a,dp
ldx D004b
lda 7,x
tfr a,dp
sts D0002
ldd 10,s
subd #1
std 10,s
lds D0004
lbsr L0556
beq L0672
ldb #$0d
lbsr L03be
L0672 ldy D000c
ldb #$0c
L0677 ldx ,y
beq L067f
lda D0002,y
sta ,x
L067f leay D0003,y
decb
bne L0677
lbsr L07e1
lbsr L0415
leay L07a9,pcr
lbsr L03c2
lbsr L07e3
lbsr L04af
lbra L038a
bsr L06b0
lblo L03be
ldx D0006
tfr u,d
pshs u
lbsr L03dc
lbsr L07e3
puls u
bra L06cc
L06b0 lbsr L0127
lda #0
os9 F$Link
rts
bsr L06b0
lblo L03be
ldd 11,u
addd #$0200
os9 F$Mem
bcc L06d0
lbsr L03be
L06cc os9 F$UnLink
rts
L06d0 os9 F$UnLink
pshs x,y,u
L06d5 lda ,x+
cmpa #$0d
bne L06d5
clrb
L06dc lda ,-x
sta ,-y
incb
cmpx ,s
bhi L06dc
sty Dfff8,y
leay Dfff4,y
sty D0002
clra
std D0001,y
puls d,x,u
stx D0006,y
ldd 9,u
leax d,u
stx D000a,y
tfr cc,a
ora #$80
sta ,y
tfr dp,a
adda #2
clrb
std D0008,y
sta D0003,y
lbra L04af
lbsr L0127
clra
clrb
tfr x,u
tfr d,y
L0715 leay D0001,y
lda ,x+
cmpa #$0d
bne L0715
clra
leax <L072e,pcr
os9 F$Fork
bcs L0729
os9 F$Wait
L0729 lblo L03be
rts
L072e com $6865
inc 12,s
neg D005f
os9 F$Exit
lbsr L0613
lblo L03be
pshs u
ldx D0000
tsta
bne L0750
L0746 cmpb ,x+
beq L075c
cmpx ,s
bne L0746
puls u,pc
L0750 cmpd ,x+
beq L075c
cmps ,s
bne L0750
puls u,pc
L075c leax -1,x
tfr x,d
leas 2,s
lbra L03dc
L0765 swi
L0766 rola
jmp -12,s
fcb $65
fcb $72
fcb $61
com -12,s
rol -10,s
fcb $65
bra L07b7
fcb $65
fcb $62
fcb $75
asr 7,s
fcb $65
fcb $72
neg D0044
L077b equ *-1
fcb $42
abx
bra L0780
L0780 bra L07a2
bra L07a4
neg D0020
comb
negb
bra L07aa
coma
coma
bra L07ae
fcb $41
bra L07b1
fcb $42
bra L07d8
negb
bra L07b7
lslb
bra L07ba
bra L07bc
rolb
bra L07bf
bra L07c1
fcb $55
L07a2 bra L07c4
L07a4 bra L07c6
negb
coma
neg D0042
L07a9 equ *-1
L07aa fcb $4b
negb
lsrb
L07ad abx
L07ae bra L07b0
L07b0 bgt L07b5
L07b1 equ *-1
bitb #$3d
com D00fc
L07b5 equ *-1
tst D0004
L07b7 equ *-1
jmp D0020
L07ba lsr D0021
L07bc blt L07c1
bitb 14852
L07bf equ *-2
L07c1 inca
fcb $4b
fcb $05
L07c4 clr 13,u
L07c6 fcb $05
cmpx $4306
exg s,y
fcb $05
fcb $18
asra
fcb $05
cmpx #$4c06
ora D0045
ror D00b9
bcc L07e0
L07d8 equ *-1
inc D0051
asr D0034
comb
asr D0038
L07e0 neg D009e
L07e1 equ *-1
ror D0086
L07e3 equ *-1
tst D00a7
suba #$9e
ror D0010
ldx #$0051
bra L07ff
L07ef tfr y,x
tfr y,u
ldy #0
L07f7 ldb ,u+
beq L07ff
leay D0001,y
bra L07f7
L07ff lda #1
os9 I$WritLn
ldx D0006
rts
L0807 ldx D0006
ldy #$0050
clra
os9 I$ReadLn
ldx D0006
rts
emod
L0817 equ *
end