====== FORMAT ======
Header for : Format
Module size: $A88 #2696
Module CRC : $1899C1 (Good)
Hdr parity : $AA
Exec. off : $009B #155
Data size : $2B39 #11065
Edition : $11 #17
Ty/La At/Rv: $11 $81
Prog mod, 6809 Obj, re-ent, R/O
===== CODE =====
* Disassembly by Os9disasm of FORMAT
mod L0a88,L000d,$11,$81,L009b,D2b39
* OS-9 system function equates
F$Exit equ $06
F$PErr equ $0f
F$PrsNam equ $10
F$AllBit equ $13
F$Time equ $15
I$Attach equ $80
I$Detach equ $81
I$Open equ $84
I$Seek equ $88
I$Read equ $89
I$Write equ $8a
I$ReadLn equ $8b
I$WritLn equ $8c
I$GetStt equ $8d
I$SetStt equ $8e
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 2
D0007 rmb 1
D0008 rmb 1
D0009 rmb 1
D000a rmb 1
D000b rmb 1
D000c rmb 2
D000e rmb 1
D000f rmb 1
D0010 rmb 1
D0011 rmb 1
D0012 rmb 1
D0013 rmb 2
D0015 rmb 1
D0016 rmb 1
D0017 rmb 1
D0018 rmb 1
D0019 rmb 1
D001a rmb 1
D001b rmb 1
D001c rmb 1
D001d rmb 2
D001f rmb 1
D0020 rmb 2
D0022 rmb 1
D0023 rmb 1
D0024 rmb 1
D0025 rmb 1
D0026 rmb 1
D0027 rmb 1
D0028 rmb 1
D0029 rmb 1
D002a rmb 1
D002b rmb 1
D002c rmb 1
D002d rmb 2
D002f rmb 1
D0030 rmb 1
D0031 rmb 1
D0032 rmb 1
D0033 rmb 1
D0034 rmb 2
D0036 rmb 2
D0038 rmb 2
D003a rmb 1
D003b rmb 2
D003d rmb 2
D003f rmb 4
D0043 rmb 1
D0044 rmb 2
D0046 rmb 15
D0055 rmb 15
D0064 rmb 28
D0080 rmb 16
D0090 rmb 71
D00d7 rmb 17
D00e8 rmb 13
D00f5 rmb 1
D00f6 rmb 10
D0100 rmb 10809
D2b39 equ .
L000d rora
clr -14,s
tst 1,s
andb 4352
L0014 equ *-1
neg D0000
L0016 equ *-1
neg D0000
L0018 equ *-1
neg D0080
L001a equ *-1
bitb ,x+
fcb $e5
neg D0000
L0020 fcb $01
neg D0028
stu $0600
fcb $01
ldd $0cff
neg D0000
ror D0000
fcb $01
ldu $0400
fcb $01
stb $0aff
ror D0000
fcb $01
addb $80e5
suba #$e5
fcb $01
stb $0aff
neg D0000
stu >$0043
fcb $01
bvc L009a
L0049 equ *-1
fcb $4e
inc D0000
com D00f6
fcb $01
ldd $204e
neg D0000
inc D0000
com D00f5
fcb $01
ldu $0400
fcb $01
stb 5710
inc D0000
com D00f5
fcb $01
addb $80e5
suba #$e5
fcb $01
stb 5710
neg D0000
fcb $4e
neg D0090
fcb $01
fcb $52
L0076 bra L00c6
neg D0000
asl D0000
com D00f5
fcb $01
ldu $0400
fcb $01
stb 5710
inc D0000
com D00f5
fcb $01
addb $80e5
suba #$e5
fcb $01
stb 6222
neg D0000
fcb $4e
neg D002c
fcb $01
L009a negb
L009b stu D0000
bsr L00be
bsr L00cf
bsr L011a
lbsr L0295
lbsr L0351
lbsr L04a9
lbsr L0586
lbsr L05bc
lbsr L07b6
ldu D0044
os9 I$Detach
clrb
L00bb os9 F$Exit
L00be leay 2,u
pshs y
leay 175,u
L00c6 clr ,-y
cmpy ,s
bhi L00c6
puls y,pc
L00cf lda ,x+
cmpa #$2f
beq L00da
L00d5 ldb #$d7
lbra L08d3
L00da os9 F$PrsNam
lblo L08d3
lda #$2f
cmpa ,y
beq L00d5
sty D0020
leay 71,u
L00ed sta ,y+
lda ,x+
decb
bpl L00ed
leax 72,u
lda #$20
sta ,y
clra
os9 I$Attach
lblo L08d3
stu D0044
ldu D0000
lda #$40
ldb #$20
std ,y
lda #2
leax 71,u
os9 I$Open
bcs L00bb
sta D0002
rts
L011a bsr L0122
bsr L015d
lbsr L0216
rts
L0122 leax 431,u
clrb
os9 I$GetStt
bcs L00bb
ldb 7,x
stb D0012
ldb 4,x
pshs b
andb #1
stb D0010
puls b
lsrb
andb #1
stb D0011
ldd 5,x
std D0013
ldb 3,x
stb D001b
andb #$20
stb D0046
ldd 9,x
std D0017
ldd 11,x
std D0019
ldb 13,x
stb D001f
ldb #1
stb D0025
clrb
rts
L015d ldx D0020
L015f leay >L0188,pcr
bsr L0176
bcs L017f
pshs d
ldd D0002,y
leay d,y
puls d
jsr ,y
bcc L015f
lbra L00bb
L0176 lda ,x+
L0178 cmpa ,y
bne L0180
ldb D0001,y
clra
L017f rts
L0180 leay D0004,y
tst ,y
bne L0178
coma
rts
L0188 fcb $52
rolb
neg D002c
fcb $72
rolb
neg D0028
bhi L0192
L0192 neg D002d
abx
neg D0000
tstb
coma
neg D0000
bhi L0200
neg D0000
fcb $1e
bvc L01a2
L01a2 neg D0013
bvs L01a6
L01a6 neg D000f
bge L01aa
L01aa neg D000b
bra L01ae
L01ae neg D0007
neg D00d7
fcb $10
rts
stb D001c
rts
stb D0012
rts
inc D0046
rts
leay 103,u
ldb #$20
L01c2 lda ,x+
cmpa #$22
beq L01d9
sta ,y+
decb
bne L01c2
L01cd ldb ,x+
cmpb #$22
beq L01df
cmpb #$20
bcc L01cd
bra L01df
L01d9 lda #$20
cmpb #$20
beq L01e3
L01df leay Dffff,y
lda ,y
L01e3 adda #$80
sta ,y
clrb
rts
lbsr L089e
ldd D001d
std D0013
rts
lbsr L089e
ldd D001d
tsta
beq L01fb
ldb #1
L01fb stb D001f
L01fd rts
lbsr L089e
L0200 equ *-1
ldd D001d
tsta
beq L0208
ldb #1
L0208 stb D0025
negb
decb
andb D0025
beq L0214
ldb #1
stb D0025
L0214 clrb
rts
L0216 leax L08e8,pcr
lbsr L0272
leay 431,u
ldx D000b,y
tst D0010
beq L0229
ldx D0009,y
L0229 stx D0017
leax L0946,pcr
ldy #$0011
lbsr L0276
leax 71,u
tfr x,y
L023b lda ,y+
cmpa #$40
bne L023b
pshs y
lda #$0d
sta Dffff,y
lbsr L0272
puls y
lda #$40
sta Dffff,y
lda D001c
bne L01fd
L0254 leax L0957,pcr
ldy #$001a
lbsr L027c
anda #$df
cmpa #$59
beq L01fd
clrb
cmpa #$4e
lbeq L00bb
bra L0254
L026e leax L0901,pcr
L0272 ldy #$0050
L0276 lda #1
os9 I$WritLn
rts
L027c pshs d,x,y,u
bsr L0276
leax ,s
ldy #1
clra
os9 I$Read
lblo L00bb
bsr L026e
puls d,x,y,u
anda #$7f
rts
L0295 leax L001a,pcr
stx D000a
ldb D001b
bitb #$c0
bne L02b9
ldb D0046
beq L02ab
leax L0076,pcr
bra L02b9
L02ab leax L0020,pcr
stx D000a
tst D0010
beq L02b9
leax L0049,pcr
L02b9 stx D000c
clra
ldb D0012
tfr d,y
clrb
ldx D0013
bsr L0303
exg d,x
subd #1
bcc L02ce
leax -1,x
L02ce exg d,x
ldy D0017
bsr L0303
exg d,x
addd D0019
std D0023
exg d,x
adcb #0
stb D0022
lda #8
pshs a
ldx D0023
ldb D0022
bsr L034c
lda D0025
pshs a
bsr L034c
tstb
beq L02fe
leax L09e1,pcr
lbsr L0272
lbra L0525
L02fe leas 2,s
stx D0026
rts
L0303 lda #8
L0305 clr ,-s
deca
bne L0305
sty ,s
stb 2,s
stx 3,s
L0311 ldd ,s
beq L0334
lsra
rorb
std ,s
bcc L0327
ldd 3,s
addd 6,s
std 6,s
lda 2,s
adca 5,s
sta 5,s
L0327 ldd 3,s
lslb
rola
std 3,s
lda 2,s
rola
sta 2,s
bra L0311
L0334 leas 5,s
puls b,x,pc
L0338 pshs b,x
lsr ,s
ror 1,s
ror 2,s
puls b,x
exg d,x
adcb #0
adca #0
exg d,x
adcb #0
L034c lsr 2,s
bne L0338
rts
L0351 tst D001b
bpl L036b
leax L0a4a,pcr
ldy #$0022
lbsr L027c
anda #$df
cmpa #$59
beq L036b
cmpa #$4e
bne L0351
rts
L036b lda D0002
ldb #3
os9 I$SetStt
lblo L00bb
ldd #0
std D0003
inca
sta D0007
L037e clr D0005
L0380 bsr L03da
leax 175,u
ldu D0003
clrb
tst D0010
beq L039b
tst D0046
bne L0399
tst D0004
bne L0399
tst D0005
beq L039b
L0399 orb #2
L039b tst D0011
beq L03a1
orb #4
L03a1 lda D0005
beq L03a7
orb #1
L03a7 tfr d,y
lda D0002
ldb #4
os9 I$SetStt
lblo L00bb
ldu D0000
ldb D0005
incb
stb D0005
cmpb D0012
bcs L0380
ldd D0003
addd #1
std D0003
cmpd D0013
bcs L037e
rts
L03cc ldy D000e
L03cf ldd ,y++
beq L03e9
L03d3 stb ,x+
deca
bne L03d3
bra L03cf
L03da lda D001b
bita #$c0
beq L03ea
ldy D000c
leax 175,u
bsr L03cf
L03e9 rts
L03ea ldy D000c
ldb D0018
tst D0046
bne L0400
tst D0004
bne L0400
tst D0005
bne L0400
ldy D000a
ldb D001a
L0400 sty D000e
stb D0009
stb D0016
bsr L0466
leax 175,u
bsr L03cf
sty D000e
L0412 bsr L03cc
dec D0009
bne L0412
lda ,y+
sty D000e
stx D003b
leay 10614,u
sty D001d
tfr a,b
L0428 std ,x++
cmpx D001d
bcs L0428
ldy D000e
ldd ,y++
std D003d
ldd ,y
std D003f
clr D0009
leax 175,u
ldd D003d
leay 135,u
L0445 leax d,x
ldd D0004
std ,x
ldb D0009
lda b,y
incb
stb D0009
ldb D0007
tst D0046
beq L0459
inca
L0459 std 2,x
lda D0009
cmpa D0016
bcc L0465
ldd D003f
bra L0445
L0465 rts
L0466 pshs b,y
tfr b,a
ldb D0004
cmpb #1
bhi L0492
leax 135,u
leay a,x
ldb D001f
bne L0481
L047a leax L0971,pcr
lbra L066d
L0481 cmpb D0016
bhi L047a
nega
pshs d,x,y
clra
L0489 sta ,x
inca
cmpa D0016
bne L0494
leas 6,s
L0492 puls b,y,pc
L0494 ldb D001f
abx
cmpx 4,s
bcs L049f
ldb ,s
leax b,x
L049f cmpx 2,s
bne L0489
leax 1,x
stx 2,s
bra L0489
L04a9 lbsr L080a
ldd D0023
std 1,x
ldb D0022
stb ,x
ldd D0017
std 17,x
stb 3,x
lda D0025
sta 7,x
clra
ldb D0026
tst D0027
beq L04c9
addd #1
L04c9 addd #1
std 9,x
clra
tst D0010
beq L04d5
ora #2
L04d5 ldb D0012
cmpb #1
beq L04dd
ora #1
L04dd tst D0011
beq L04e3
ora #4
L04e3 sta 16,x
ldd D0026
std 4,x
lda #255
sta 13,x
leax 201,u
os9 F$Time
leax 206,u
leay 103,u
tst ,y
beq L0508
L0500 lda ,y+
sta ,x+
bpl L0500
bra L053b
L0508 leax L0995,pcr
ldy #$000b
lbsr L0276
leax 206,u
ldy #$0021
clra
os9 I$ReadLn
bcc L052c
cmpa #$d3
bne L0508
L0525 leax L09d2,pcr
lbra L066d
L052c tfr y,d
leax d,x
clr ,-x
decb
beq L0508
lda ,-x
ora #$80
sta ,x
L053b leax 201,u
leay 64,x
pshs y
ldd #0
L0547 addd ,x++
cmpx ,s
bcs L0547
leas 2,s
std 189,u
ldd L0014,pcr
std 415,u
ldd L0016,pcr
std 417,u
ldd L0018,pcr
std 419,u
lda D0002
ldb #0
leax 238,u
os9 I$GetStt
ldb #3
os9 I$SetStt
lblo L00bb
leax 175,u
lbra L0816
L0586 lda D0002
os9 I$Close
leax 71,u
lda #1
os9 I$Open
lblo L0669
sta D0002
leax 175,u
ldy #$0100
os9 I$Read
lblo L0669
lda D0002
os9 I$Close
leax 71,u
lda #3
os9 I$Open
lblo L0669
sta D0002
rts
L05bc lda D001b
clr D0043
bita #$80
beq L05db
L05c4 leax L0a6c,pcr
ldy #$0019
lbsr L027c
anda #$df
cmpa #$59
beq L05db
cmpa #$4e
bne L05c4
sta D0043
L05db ldd D0019
std D0015
clra
clrb
std D0034
std D0003
std D0008
std D0030
stb D002f
sta D003a
leax 431,u
stx D0036
lbsr L080e
leax 256,x
stx D0038
clra
ldb #1
std D0032
lda D0025
sta D0029
clr D0028
clra
ldb D0026
tst D0027
beq L0611
addd #1
L0611 addd #9
std D002b
lda D0025
L0618 lsra
bcs L0629
lsr D002b
ror D002c
bcc L0618
inc D002c
bne L0618
inc D002b
bra L0618
L0629 ldb D002c
stb D002d
lda D0025
mul
std D002b
subd #1
subb D0026
sbca #0
tst D0027
beq L0640
subd #1
L0640 stb D002a
L0642 tst D0043
bne L0674
lda D0002
leax 175,u
ldy #$0100
os9 I$Read
bcc L0674
os9 F$PErr
lbsr L083a
lda #255
sta D0028
tst D002f
bne L0674
ldx D0030
cmpx D002b
bhi L0674
L0669 leax L09bf,pcr
L066d lbsr L0272
clrb
lbra L00bb
L0674 ldd D0008
addd #1
std D0008
cmpd D0015
bcs L06b9
clr D0008
clr D0009
tst D0043
bne L06ae
lda #$20
pshs a
lda D0004
lbsr L071b
pshs d
lda D0003
lbsr L071b
pshs b
tfr s,x
ldy #4
lbsr L0276
lda 2,s
cmpa #$46
bne L06ac
lbsr L026e
L06ac leas 4,s
L06ae ldd D0003
addd #1
std D0003
ldd D0017
std D0015
L06b9 dec D0029
bne L06cf
bsr L06f8
tst D0028
bne L06c9
ldx D0034
leax 1,x
stx D0034
L06c9 clr D0028
lda D0025
sta D0029
L06cf ldb D002f
ldx D0030
leax 1,x
bne L06d8
incb
L06d8 cmpb D0022
bcs L06e0
cmpx D0023
bcc L06e7
L06e0 stb D002f
stx D0030
lbra L0642
L06e7 lda #255
sta D0028
leay 431,u
L06ef cmpy D0036
beq L0733
bsr L06f8
bra L06ef
L06f8 ldx D0036
lda D0028
rora
rol ,x+
inc D003a
lda D003a
cmpa #8
bcs L071a
clr D003a
stx D0036
cmpx D0038
bne L071a
bsr L0777
leax 431,u
stx D0036
lbsr L080e
L071a rts
L071b tfr a,b
lsra
lsra
lsra
lsra
andb #$0f
addd #12336
cmpa #$39
bls L072c
adda #7
L072c cmpb #$39
bls L0732
addb #7
L0732 rts
L0733 lbsr L026e
leax L0a31,pcr
ldy #$0019
lbsr L0276
ldb D0025
clra
ldx D0034
pshs a,x
L0748 lsrb
bcs L0753
asl 2,s
rol 1,s
rol ,s
bra L0748
L0753 puls a,x
ldb #$0d
pshs b
tfr d,y
tfr x,d
tfr b,a
bsr L071b
pshs d
tfr x,d
bsr L071b
pshs d
tfr y,d
bsr L071b
pshs d
tfr s,x
lbsr L0272
leas 7,s
rts
L0777 pshs y
clra
ldb #1
cmpd D0032
bne L0792
leax 431,u
clra
ldb D002d
tfr d,y
clrb
os9 F$AllBit
lblo L0669
L0792 lbsr L0824
leax 431,u
bsr L0816
ldd D0022
cmpd D002f
bcs L07ad
bhi L07aa
ldb D0024
cmpb D0031
bcc L07ad
L07aa lbsr L083a
L07ad ldd D0032
addd #1
std D0032
puls y,pc
L07b6 bsr L0824
leax 687,u
bsr L080e
leax 690,u
os9 F$Time
leax 687,u
lda #$bf
sta ,x
lda #2
sta 8,x
clra
ldb #$40
std 11,x
ldb D002a
decb
stb 20,x
ldd D0032
addd #1
std 17,x
bsr L0816
bsr L080a
ldd #$2eae
std ,x
stb 32,x
ldd D0032
std 30,x
std 62,x
bsr L0816
bsr L080a
ldb D002a
L07fe decb
bne L0802
rts
L0802 pshs b
bsr L0816
puls b
bra L07fe
L080a leax 175,u
L080e clra
clrb
L0810 sta d,x
decb
bne L0810
rts
L0816 lda D0002
ldy #$0100
os9 I$Write
lblo L00bb
rts
L0824 clra
ldb D0032
tfr d,x
lda D0033
clrb
tfr d,u
L082e lda D0002
os9 I$Seek
ldu D0000
lblo L00bb
rts
L083a ldx D002f
lda D0031
clrb
addd #$0100
tfr d,u
bcc L082e
leax 1,x
bra L082e
ldd ,y
leau 175,u
leax >L0892,pcr
ldy #$2f20
L0858 leay D0100,y
subd ,x
bcc L0858
addd ,x++
pshs d
ldd ,x
tfr y,d
beq L0880
ldy #$2f30
cmpd #12320
bne L087a
ldy #$2f20
tfr b,a
L087a sta ,u+
puls d
bra L0858
L0880 sta ,u+
lda #$0d
sta ,u
ldu D0000
leas 2,s
leax 175,u
lbsr L0272
rts
L0892 beq L08a4
com D00e8
neg D0064
neg D000a
neg D0001
neg D0000
L089e ldd #0
L08a1 bsr L08b1
bcs L08ab
L08a4 equ *-1
bne L08a1
std D001d
bne L08b0
L08ab ldd #1
std D001d
L08b0 rts
L08b1 pshs d,y
ldb ,x+
subb #$30
cmpb #$0a
bcc L08cf
lda #0
ldy #$000a
L08c1 addd ,s
bcs L08cd
leay Dffff,y
bne L08c1
std ,s
andcc #251
L08cd puls d,y,pc
L08cf orcc #4
puls d,y,pc
L08d3 lda #2
os9 F$PErr
leax
===== RTS =====
Return to [[:OS-9:]] or [[:Top:]]