* Disassembly by Os9disasm of deldir
mod L027c,L000d,$11,$81,L0014,D019a
* OS-9 system function equates
F$Fork equ $03
F$Wait equ $04
F$Exit equ $06
F$PrsNam equ $10
I$Open equ $84
I$ChgDir equ $86
I$Delete equ $87
I$Seek equ $88
I$Read equ $89
I$ReadLn equ $8b
I$WritLn equ $8c
I$GetStt equ $8d
I$Close equ $8f
* class D external label equates
Dffff equ $ffff
* OS9 data area definitions
D0000 rmb 2
D0002 rmb 1
D0003 rmb 12
D000f rmb 17
D0020 rmb 14
D002e rmb 6
D0034 rmb 15
D0043 rmb 1
D0044 rmb 1
D0045 rmb 1
D0046 rmb 2
D0048 rmb 4
D004c rmb 65
D008d rmb 269
D019a equ .
L000d lsra
fcb $65
inc 4,s
rol [,-s]
com D008d
L0014 equ *-1
abx
bcs L0042
bsr L0091
bcc L002b
lbsr L010c
bcs L0042
lbsr L01c3
bcs L0042
lbsr L0242
bcs L0042
L002b lda D0002
os9 I$Close
bcs L004d
ldx D0000
os9 I$Delete
bcs L004d
lda ,x
cmpa #$0d
bne L0014
clrb
bra L004d
L0042 pshs b
lda D0002
os9 I$Close
puls b
orcc #1
L004d os9 F$Exit
stx D0000
lda #3
os9 I$Open
bcs L005d
sta D0002
bra L0089
L005d ldx D0000
lda #$81
os9 I$Open
bcs L0090
sta D0002
L0068 ldx D0000
os9 F$PrsNam
clra
incb
std D0046
lda ,y
cmpa #$2f
bne L0089
lda #$0d
sta ,y+
lda #3
ldx D0000
os9 I$ChgDir
bcs L0090
sty D0000
bra L0068
L0089 leax -28,u
stx D0044
clr D0003
L0090 rts
L0091 lda D0002
ldb #0
leax 4,u
os9 I$GetStt
bcs L00ab
ldx D0044
lda 51,x
anda #$80
beq L00aa
clrb
orcc #1
bra L00ab
L00aa clrb
L00ab rts
L00ac dec D0044
fcb $65
inc 5,s
lsr $696e
fcb $67
bra L011b
rol -14,s
fcb $65
com -12,s
clr -14,s
rol $2066
rol 12,s
fcb $65
bgt L00e6
dec D004c
rol -13,s
lsr $2064
rol -14,s
fcb $65
com -12,s
clr -14,s
rol $2c20
lsr 5,s
inc 5,s
lsr $6520
lsr 9,s
fcb $72
fcb $65
com -12,s
clr -14,s
L00e6 rol $2c20
clr -14,s
bra L015e
fcb $75
rol -12,s
bra L0131
bra L011c
inc D000f,y
lsr D000f,y
fcb $71
bvs L011b
L00fb dec D0043
clr 14,s
lsr $696e
fcb $75
fcb $65
swi
bra L012f
rol $2f6e
bvs L012c
L010c tstb
bne L013e
lda #1
leax <L00ac,pcr
ldy #$004f
os9 I$WritLn
L011b bcs L013e
L011c equ *-1
bsr L0179
bcs L013e
ldb D0003
cmpb #1
bne L012a
clrb
bra L013e
L012a bsr L0145
L012c bcs L013e
leax <L00fb,pcr
L012f equ *-2
L0131 ldy #$0011
lda #1
os9 I$WritLn
bcs L013e
bsr L0179
L013e rts
L013f lsra
rola
fcb $52
tst D0045
L0143 equ *-1
bra L017a
L0145 equ *-1
nega
leau 74,u
pshs u
ldb #2
leax <L0143,pcr
lbsr L0270
ldx D0000
ldd D0046
decb
lbsr L0270
lda #$0d
L015e sta ,u+
tfr u,d
subd ,s
tfr d,y
puls u
leax <L013f,pcr
lda #$11
clrb
os9 F$Fork
puls u
bcs L013e
os9 F$Wait
rts
L0179 leax 74,u
L017a equ *-2
ldy #$0050
lda #0
os9 I$ReadLn
bcs L01b8
L0187 lda ,x+
cmpa #$20
beq L0187
eora #$59
anda #$df
beq L01ad
lda ,-x
eora #$4c
anda #$df
beq L01a9
lda ,x
eora #$44
anda #$df
beq L01a5
bra L01b4
L01a5 ldb #1
bra L01af
L01a9 ldb #2
bra L01af
L01ad ldb #4
L01af stb D0003
clrb
bra L01b8
L01b4 ldb #1
orcc #1
L01b8 rts
L01b9 lsra
fcb $45
inca
lsra
rola
fcb $52
tst D002e
L01c0 equ *-1
bgt L01d0
L01c3 ldb D0003
bitb #5
beq L0210
lda D0002
pshs u
ldu #64
L01d0 ldx #0
os9 I$Seek
puls u
L01d8 bsr L0215
bcs L0209
ldx D0000
lda #3
os9 I$ChgDir
bcs L0214
ldy D0048
clrb
lda #$11
pshs u
leau 36,u
leax <L01b9,pcr
os9 F$Fork
puls u
bcs L0214
os9 F$Wait
bcs L0214
leax <L01c0,pcr
lda #3
os9 I$ChgDir
bcc L01d8
L0209 cmpb #$d3
bne L0214
clrb
bra L0214
L0210 ldb #1
orcc #1
L0214 rts
L0215 lda D0002
leax 36,u
ldy #$0020
os9 I$Read
bcs L0238
lda ,x
beq L0215
os9 F$PrsNam
lda Dffff,y
anda #$7f
sta Dffff,y
lda #$0d
sta ,y
clra
incb
std D0048
L0238 rts
L0239 fcb $41
lsrb
lsrb
fcb $52
tst D0020
L023e equ *-1
blt L02a5
tst D0034
L0242 equ *-1
nega
leau 74,u
pshs u
ldd D0046
decb
ldx D0000
bsr L0270
leax <L023e,pcr
ldb #4
bsr L0270
tfr u,d
subd ,s
tfr d,y
puls u
leax <L0239,pcr
clrb
lda #$11
os9 F$Fork
bcs L026d
os9 F$Wait
L026d puls u
rts
L0270 decb
lda ,x+
sta ,u+
tstb
bne L0270
rts
emod
L027c equ *
end