A2osX/BASIC.FX/BASIC.S.B.txt

1746 lines
24 KiB
Plaintext
Raw Normal View History

NEW
AUTO 3,1
*--------------------------------------
2022-03-13 12:52:24 +00:00
BS.WHICHBITS .HS 8040201008040201
BS.GETBUFR jsr LA1FB
bcs LA304
2022-03-15 19:33:19 +00:00
pha
sbc #$03
sta XBBB8
pla
LA2C5 sta GP.SBUFADR+1
ldx GP.OPENCNT
beq LA2EE
2022-03-13 12:52:24 +00:00
lda XBBB7
clc
adc #$04
sta XBBB7
LA2D6 cmp XBBEE,x
bne LA2EB
2022-03-13 12:52:24 +00:00
lda GP.SBUFADR+1
jsr LA356
jsr LA29F
2022-03-13 12:52:24 +00:00
lda GP.SBUFADR+1
adc #$04
bcc LA2C5
LA2EB dex
bne LA2D6
2022-03-13 12:52:24 +00:00
LA2EE lda GP.SBUFADR+1
bit GP.EXECACTV
bpl LA303
LA2F6 ldx #$08
jsr LA356
jsr LA29F
2022-03-13 12:52:24 +00:00
lda GP.SBUFADR+1
adc #$04
LA303 clc
LA304 rts
2022-03-13 12:52:24 +00:00
BS.FREEBUFR lda GP.OPENCNT
asl
asl
adc AS.HIMEM+1
sta XBBB7
2022-03-13 12:52:24 +00:00
lda AS.HIMEM+1
sta XBBB8
2022-03-13 12:52:24 +00:00
lda GP.RSHIMEM
cmp AS.HIMEM+1
beq LA354
sta AS.HIMEM+1
bit GP.EXECACTV
bpl LA327
jsr LA2F6
bcc LA345
2022-03-13 12:52:24 +00:00
LA327 lda XBBB7
ldx GP.OPENCNT
beq LA351
LA32F cmp XBBEE,x
bne LA34E
2022-03-13 12:52:24 +00:00
lda AS.HIMEM+1
jsr LA356
jsr LA29F
sec
2022-03-13 12:52:24 +00:00
lda XBBB7
sbc #$04
sta XBBB7
2022-03-13 12:52:24 +00:00
LA345 lda AS.HIMEM+1
sec
sbc #$04
sta AS.HIMEM+1
bcs LA327
LA34E dex
bne LA32F
LA351 jsr BS.KW.01
LA354 clc
rts
LA356 pha
2022-03-13 12:52:24 +00:00
lda XBBB8
jsr LA29F
pla
rts
LA35F ldy #$00
cpy XBBEE
beq LA376
2022-03-13 12:52:24 +00:00
LA366 lda (ZP.PCL),y
sta (ZP.A1L),y
iny
bne LA366
inc ZP.PCH
inc ZP.A1H
dec XBBEE
bne LA366
LA376 cpy XBBED
beq LA382
2022-03-13 12:52:24 +00:00
lda (ZP.PCL),y
sta (ZP.A1L),y
iny
bne LA376
LA382 rts
2022-03-15 19:33:19 +00:00
*--------------------------------------
LA383 ldy XBBED
XA386 beq LA38F SELF MODIFIED
LA388 jsr LA39A
dec ZP.A1H
dec ZP.PCH
LA38F cpy XBBEE
beq LA3A2
dec XBBEE
jmp LA388
2022-03-15 19:33:19 +00:00
*--------------------------------------
LA39A dey
2022-03-13 12:52:24 +00:00
lda (ZP.PCL),y
sta (ZP.A1L),y
tya
bne LA39A
LA3A2 rts
2022-03-15 19:33:19 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
LA3A3 lda AS.VARSTART+1
sta ZP.A2H
2022-03-13 12:52:24 +00:00
lda AS.VARSTART
ldx AS.ARRAYSTART+1
clc
bcc LA3B3
LA3AE clc
2022-03-13 12:52:24 +00:00
lda ZP.A2L
adc #$07
LA3B3 sta ZP.A2L
bcc LA3B9
inc ZP.A2H
LA3B9 eor AS.ARRAYSTART
bne LA3BF
cpx ZP.A2H
LA3BF clc
beq LA3D6
ldy #$00
2022-03-13 12:52:24 +00:00
lda (ZP.A2L),y
iny
eor (ZP.A2L),y
bpl LA3AE
2022-03-13 12:52:24 +00:00
lda (ZP.A2L),y
bpl LA3AE
iny
jsr LA3FD
jmp LA3AE
2022-03-13 12:52:24 +00:00
LA3D6 lda ZP.A2L
sta XBBDC
LA3DB clc
jsr LA160
bcs LA410
LA3E1 ldy #$00
clc
jsr LA3FD
clc
2022-03-13 12:52:24 +00:00
lda #$03
adc ZP.A2L
sta ZP.A2L
bcc LA3F2
inc ZP.A2H
LA3F2 cmp XBBDC
bne LA3E1
cpx ZP.A2H
bne LA3E1
beq LA3DB
2022-03-13 12:52:24 +00:00
LA3FD lda (ZP.A2L),y
beq LA410
iny
iny
2022-03-13 12:52:24 +00:00
lda AS.VARSTART+1
cmp (ZP.A2L),y
bcs LA410
2022-03-13 12:52:24 +00:00
lda (ZP.A2L),y
adc XBBE2
sta (ZP.A2L),y
LA410 rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
LA411 jsr LA021
bcs LA47F
2022-03-13 12:52:24 +00:00
lda AS.ARRAYEND
sec
sbc AS.VARSTART
sta BS.BAS.HDR
sta XBBED
2022-03-13 12:52:24 +00:00
lda AS.ARRAYEND+1
sbc AS.VARSTART+1
sta BS.BAS.HDR+1
sta XBBEE
2022-03-13 12:52:24 +00:00
lda AS.ARRAYSTART
sbc AS.VARSTART
sta BS.BAS.HDR+2
2022-03-13 12:52:24 +00:00
lda AS.ARRAYSTART+1
sbc AS.VARSTART+1
sta BS.BAS.HDR+3
2022-03-13 12:52:24 +00:00
lda AS.STRINGSTART
sbc XBBED
sta ZP.A1L
2022-03-13 12:52:24 +00:00
lda AS.STRINGSTART+1
sbc #$00
sta ZP.A1H
2022-03-13 12:52:24 +00:00
lda AS.ARRAYEND
sbc XBBED
sta ZP.PCL
2022-03-13 12:52:24 +00:00
lda AS.ARRAYEND+1
sbc #$00
sta ZP.PCH
2022-03-13 12:52:24 +00:00
lda #$03
sta XA386+1
jsr LA383
2022-03-13 12:52:24 +00:00
lda #$07
sta XA386+1
2022-03-13 12:52:24 +00:00
lda ZP.A1L
sta XBBE9
inc ZP.A1H
2022-03-13 12:52:24 +00:00
lda ZP.A1H
sta XBBEA
2022-03-13 12:52:24 +00:00
lda AS.HIMEM
sec
sbc ZP.A1L
sta XBBEB
2022-03-13 12:52:24 +00:00
lda AS.HIMEM+1
sta BS.BAS.HDR+4
sbc ZP.A1H
sta XBBEC
clc
LA47F rts
2022-03-13 12:52:24 +00:00
LA480 lda BS.BAS.HDR
sta XBBED
clc
adc AS.VARSTART
sta AS.ARRAYEND
2022-03-13 12:52:24 +00:00
lda BS.BAS.HDR+1
sta XBBEE
adc AS.VARSTART+1
sta AS.ARRAYEND+1
2022-03-13 12:52:24 +00:00
lda AS.VARSTART
sta ZP.A1L
adc BS.BAS.HDR+2
sta AS.ARRAYSTART
2022-03-13 12:52:24 +00:00
lda AS.VARSTART+1
sta ZP.A1H
adc BS.BAS.HDR+3
sta AS.ARRAYSTART+1
2022-03-13 12:52:24 +00:00
lda XBBE9
sta ZP.PCL
2022-03-13 12:52:24 +00:00
lda XBBEA
sta ZP.PCH
jsr LA35F
2022-03-13 12:52:24 +00:00
lda XBBED
clc
adc ZP.PCL
sta AS.STRINGSTART
2022-03-13 12:52:24 +00:00
lda ZP.PCH
adc #$00
sta AS.STRINGSTART+1
sec
2022-03-13 12:52:24 +00:00
lda AS.HIMEM+1
sbc BS.BAS.HDR+4
beq LA4D0
sta XBBE2
jsr LA3A3
LA4D0 clc
rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
LA4D2 jsr BS.LINEBUFCLR80
2022-03-13 12:52:24 +00:00
lda #$A2
sta IO.LINEBUF
2022-03-13 12:52:24 +00:00
lda DIRENTBUF
and #$0F
tay
2022-03-13 12:52:24 +00:00
LA4E0 lda DIRENTBUF,y
ora #$80
sta IO.LINEBUF+1,y
dey
bne LA4E0
2022-03-13 12:52:24 +00:00
.DO LOWERCASE=1
lda DIRENTBUF+$1D
bpl .18
lda DIRENTBUF
and #$0f
tay
.10 cpy #8
bcs .13
lda DIRENTBUF+$1D
and BS.WHICHBITS,y
beq .15
bne .14
.13 lda DIRENTBUF+$1C
and BS.WHICHBITS-8,y
beq .15
.14 lda IO.LINEBUF+1,y
eor #$20
sta IO.LINEBUF+1,y
.15 dey
bne .10
.18 .FIN
stz BS.TMPBUF4+2
lda DIRENTBUF.TYPE
ldx #$0E
LA4F3 iny
iny
cmp BS.PRODOSTYPES.H,x
beq LA505
iny
dex
bpl LA4F3
ldy #$13
jsr BS.AHEX2LINEBUFY
bne LA549
LA505 ldx #$02
pha
2022-03-13 12:52:24 +00:00
LA508 lda BS.PRODOSTYPES.ASC,y
sta $212,x
dey
dex
bpl LA508
2022-03-13 12:52:24 +00:00
pla
bit BS.CATWIDTH
bvc LA561
ldy #$4E
cmp #$06
beq LA533
cmp #$04
bne LA549
2022-03-13 12:52:24 +00:00
lda #$D2
sta $249
2022-03-13 12:52:24 +00:00
lda DIRENTBUF.AUXT
ldx DIRENTBUF.AUXT+1
jsr BS.AXDEC2LINEBUFY
jmp LA544
2022-03-13 12:52:24 +00:00
LA533 lda #$C1
sta $249
2022-03-13 12:52:24 +00:00
lda DIRENTBUF.AUXT
jsr BS.AHEX2LINEBUFY
2022-03-13 12:52:24 +00:00
lda DIRENTBUF.AUXT+1
jsr BS.AHEX2LINEBUFY
2022-03-13 12:52:24 +00:00
LA544 lda #$BD
sta $24A
2022-03-13 12:52:24 +00:00
LA549 lda DIRENTBUF.EOF+2
sta BS.TMPBUF4+2
2022-03-13 12:52:24 +00:00
lda DIRENTBUF.EOF
ldx DIRENTBUF.EOF+1
ldy #$46
jsr BS.AXDEC2LINEBUFY
ldx #$18
ldy #$3D
jsr LA57E
LA561 ldy #$1B
2022-03-13 12:52:24 +00:00
lda DIRENTBUF.UBLK
ldx DIRENTBUF.UBLK+1
jsr BS.AXDEC2LINEBUFY
2022-03-13 12:52:24 +00:00
lda DIRENTBUF.ACCESS
and #$C2
cmp #$C2
beq LA57A
2022-03-13 12:52:24 +00:00
lda #$AA
sta IO.LINEBUF+1
LA57A ldx #$21
ldy #$2C
2022-03-13 12:52:24 +00:00
LA57E lda $25A,x
lsr
sta XBC10
2022-03-13 12:52:24 +00:00
lda DIRENTBUF,x
pha
and #$1F
sta XBC0F
pla
rol
rol
rol
rol
and #$0F
beq LA5B1
cmp #$0D
bcs LA5B1
sta XBC0E
asl
adc XBC0E
sta XBC0E
2022-03-13 12:52:24 +00:00
lda XBC0F
beq LA5B1
2022-03-13 12:52:24 +00:00
lda XBC10
cmp #$64
bcc LA5C3
LA5B1 tya
sec
sbc #$06
tay
ldx #$08
2022-03-13 12:52:24 +00:00
LA5B8 lda BS.NODATE,x
sta IO.LINEBUF+1,y
dey
dex
bpl LA5B8
rts
2022-03-13 12:52:24 +00:00
LA5C3 lda $25C,x
pha
2022-03-13 12:52:24 +00:00
lda $25B,x
ldx #$00
cmp #$3C
bcc LA5D1
txa
LA5D1 jsr LA618
2022-03-13 12:52:24 +00:00
lda #$BA
sta IO.LINEBUF+1,y
dey
pla
ldx #$00
cmp #$18
bcc LA5E2
txa
LA5E2 cmp #$0A
php
jsr BS.AXDEC2LINEBUFY
plp
bcs LA5EC
dey
LA5EC dey
2022-03-13 12:52:24 +00:00
lda XBC10
jsr LA618
dey
ldx XBC0E
inx
inx
inx
2022-03-13 12:52:24 +00:00
LA5FA lda BS.MONTHS-4,x
sta IO.LINEBUF+1,y
dey
dex
cpx XBC0E
bne LA5FA
2022-03-13 12:52:24 +00:00
lda #$AD
sta IO.LINEBUF+1,y
sta $205,y
dey
2022-03-13 12:52:24 +00:00
lda XBC0F
ldx #$00
jmp BS.AXDEC2LINEBUFY
LA618 clc
adc #$64
jsr BS.AXDEC2LINEBUFY
iny
rts
BS.AHEX2LINEBUFY
pha
and #$0F
jsr LA62B
pla
lsr
lsr
lsr
lsr
LA62B ora #$B0
cmp #$BA
bcc LA633
adc #$06
LA633 sta IO.LINEBUF+1,y
dey
2022-03-13 12:52:24 +00:00
lda #$A4
sta IO.LINEBUF+1,y
rts
BS.AXDEC2LINEBUFY
stx BS.TMPBUF4+1
sta BS.TMPBUF4
LA643 jsr LA65B
2022-03-13 12:52:24 +00:00
lda BS.TMPBUF4+3
ora #$B0
sta IO.LINEBUF+1,y
dey
2022-03-13 12:52:24 +00:00
lda BS.TMPBUF4
ora BS.TMPBUF4+1
ora BS.TMPBUF4+2
bne LA643
rts
LA65B ldx #$18
2022-03-13 12:52:24 +00:00
lda #$00
sta BS.TMPBUF4+3
LA662 jsr BS.TMPBUF3x2
rol BS.TMPBUF4+3
sec
2022-03-13 12:52:24 +00:00
lda BS.TMPBUF4+3
sbc #$0A
bcc LA676
sta BS.TMPBUF4+3
inc BS.TMPBUF4
LA676 dex
bne LA662
rts
2022-03-13 12:52:24 +00:00
BS.LINEBUFCLR80 lda #$A0
ldx #$4F
LA67E sta IO.LINEBUF+1,x
dex
bpl LA67E
rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.DOSCMD lda #$FF
sta GP.XCNUM
2022-03-13 12:52:24 +00:00
lda #$20
sta BS.GetCharSep
2022-03-13 12:52:24 +00:00
lda #$08
sta BS.GetCharMax
jsr BS.GetKWInCmdBuf
2022-03-13 12:52:24 +00:00
lda BS.CMDBUF
cmp #'A'
bcs LA6A5
2022-03-13 12:52:24 +00:00
eor #'-'
beq LA6A5
LA6A2 jmp BS.ERR10
LA6A5 jsr BS.IsIntCmdMTR
bcs LA6A2
2022-03-13 12:52:24 +00:00
lda GP.STATE
bne LA6BA
2022-03-13 12:52:24 +00:00
lda GP.EXECACTV
bne LA6BA
jsr MON.CLREOL
jsr BS.CROUT
2022-03-13 12:52:24 +00:00
LA6BA stz GP.FoundBITS
stz GP.FoundBITS+1
stz BS.CMDBUF
stz MLI.PATHBUF
lda GP.VDEFSLT
sta GP.ParamS
2022-03-13 12:52:24 +00:00
lda GP.VDEFDRV
sta GP.ParamD
2022-03-13 12:52:24 +00:00
lda AS.HIMEM+1
sta XBBE3
ldx GP.XLEN
inx
inx
stx BS.GetCharMax
2022-03-13 12:52:24 +00:00
lda GP.AllowedBITS
beq LA744
asl
bmi LA747
jsr BS.GetKWInCmdBuf
php
pha
2022-03-13 12:52:24 +00:00
lda GP.AllowedBITS
bpl LA6F8
2022-03-13 12:52:24 +00:00
lda #MLI.C.GETPREFIX
jsr GP.GOSYSTEM
LA6F8 pla
plp
beq LA744
2022-03-13 12:52:24 +00:00
cmp #','
bne LA703
jmp LA795
2022-03-13 12:52:24 +00:00
LA703 cmp #'/'
beq LA70B
2022-03-13 12:52:24 +00:00
cmp #'A'
bcc LA73D
LA70B dex
2022-03-13 12:52:24 +00:00
lda #$82
sta BS.GetCharSep
lsr
sta BS.GetCharMax
ldy #$00
jsr LAA2D
dey
sty BS.CMDBUF.LEN
2022-03-13 12:52:24 +00:00
lda #CMDBITS0.FN1
sta GP.FoundBITS
2022-03-13 12:52:24 +00:00
LA723 lda BS.CMDBUF.LEN,y
sta MLI.PATHBUF,y
dey
bpl LA723
dex
jsr BS.GetCharSpaceSep
bne LA73A
bcc LA7A6
2022-03-13 12:52:24 +00:00
lda GP.AllowedBITS
lsr
bcs LA770
LA73A jmp BS.ERR10
2022-03-13 12:52:24 +00:00
LA73D lda GP.XCNUM
cmp #$06
bne LA73A
LA744 jmp LA7A6
LA747 jsr BS.GetKWInCmdBuf
beq LA73A
cmp #$41
beq LA79A
jsr BS.TMPBUF3Reset
2022-03-13 12:52:24 +00:00
stz XBC08
ldy #$13
sty XBC09
ldy #$40
sty GP.FoundBITS
2022-03-13 12:52:24 +00:00
jsr LA96E
bcs LA76F
2022-03-13 12:52:24 +00:00
lda GP.ParamINPR
cmp #$08
bcc LA79F
2022-03-13 12:52:24 +00:00
LA76C lda #$02
sec
LA76F rts
LA770 lsr
bcc LA795
jsr BS.GetCharSpaceSep
beq LA73A
dex
2022-03-13 12:52:24 +00:00
lda #$82
sta BS.GetCharSep
ldy #$01
jsr BS.GetPathInPathBuf
dey
dey
sty MLI.PATHBUF
2022-03-13 12:52:24 +00:00
lda #$03
sta GP.FoundBITS
dex
jsr BS.GetCharSpaceSep
bne LA73A
bcc LA7A6
LA795 jsr BS.GetCharSpaceSep
beq LA73A
LA79A jsr LA8F6
bcs LA76F
LA79F jsr BS.GetCharSpaceSep
bne LA73A
bcs LA795
2022-03-13 12:52:24 +00:00
LA7A6 lda GP.ParamS
beq LA76C
cmp #$08
bcs LA76C
2022-03-13 12:52:24 +00:00
lda GP.ParamD
beq LA76C
cmp #$03
bcs LA76C
2022-03-13 12:52:24 +00:00
lda GP.AllowedBITS
and #$21
lsr
beq LA7C9
2022-03-13 12:52:24 +00:00
lda GP.STATE
bne LA7C9
2022-03-13 12:52:24 +00:00
lda #$0F
sec
rts
LA7C9 bcc LA80B
2022-03-13 12:52:24 +00:00
lda GP.AllowedBITS+1
and #$04
beq LA80B
2022-03-13 12:52:24 +00:00
lda GP.FoundBITS
lsr
bcs LA7E1
2022-03-13 12:52:24 +00:00
lda GP.AllowedBITS
and #$90
beq BS.ERR10
bpl LA80B
2022-03-13 12:52:24 +00:00
LA7E1 lda BS.CMDBUF
eor #$2F
beq LA7ED
2022-03-13 12:52:24 +00:00
lda MLI.PFIXPTR
beq LA806
2022-03-13 12:52:24 +00:00
LA7ED lda GP.FoundBITS+1
and #$04
beq LA80B
bcs LA806
2022-03-13 12:52:24 +00:00
stz BS.CMDBUF.LEN
stz BS.CMDBUF
lda #$01
2022-03-15 19:33:19 +00:00
tsb GP.FoundBITS
LA806 jsr BS.GetVolAtSxDy
bcs LA849
2022-03-13 12:52:24 +00:00
LA80B lda GP.XCNUM
asl
tax
2022-03-13 12:52:24 +00:00
lda BS.KW.JMP,x
sta BS.KW.JMPADDR
2022-03-13 12:52:24 +00:00
lda BS.KW.JMP+1,x
sta BS.KW.JMPADDR+1
2022-03-13 12:52:24 +00:00
* >DEBUG
clc
txa
beq LA844
eor #$32
beq LA844
2022-03-13 12:52:24 +00:00
lda GP.AllowedBITS+1
and #$04
beq LA844
2022-03-13 12:52:24 +00:00
lda GP.FoundBITS
lsr
bcc LA844
jsr BS.GetFileInfo
bcc LA844
cmp #$07
bne LA849
2022-03-13 12:52:24 +00:00
lda GP.AllowedBITS
and #$08
bne LA844
2022-03-13 12:52:24 +00:00
lda #$06
rts
LA844 jmp (BS.KW.JMPADDR)
2022-03-13 12:52:24 +00:00
BS.ERR10 lda #$10
LA849 sec
rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.GetVolAtSxDy lda GP.ParamS
asl
asl
asl
asl
asl
pha
2022-03-13 12:52:24 +00:00
lda GP.ParamD
eor #$01
lsr
pla
ror
sta GP.MLIMRKEOFBUF.REFNUM
2022-03-13 12:52:24 +00:00
ldx #$01
ldy #$02
jsr BS.SetSBUFADRXY
lda #MLI.C.ONLINE
jsr GP.GOSYSTEM
bcs LA849
2022-03-13 12:52:24 +00:00
lda GP.ParamD
sta GP.VDEFDRV
2022-03-13 12:52:24 +00:00
lda GP.ParamS
sta GP.VDEFSLT
2022-03-13 12:52:24 +00:00
lda BS.CMDBUF
eor #$2F
beq LA8F4
2022-03-13 12:52:24 +00:00
lda IO.LINEBUF+1
and #$0F
adc #$02
sta IO.LINEBUF+1
adc BS.CMDBUF.LEN
cmp #$40
tax
2022-03-13 12:52:24 +00:00
lda #$10
bcs LA8F5
ldy BS.CMDBUF.LEN
stx BS.CMDBUF.LEN
LA89D dex
dey
bmi LA8AA
2022-03-13 12:52:24 +00:00
lda BS.CMDBUF,y
sta BS.CMDBUF,x
jmp LA89D
2022-03-13 12:52:24 +00:00
LA8AA lda #$2F
sta BS.CMDBUF
LA8AF sta BS.CMDBUF,x
2022-03-13 12:52:24 +00:00
lda IO.LINEBUF,x
dex
bne LA8AF
2022-03-13 12:52:24 +00:00
lda GP.XCNUM
cmp #$0B
beq LA8F4
cmp #$16
beq LA8F4
cmp #$08
beq LA8F4
2022-03-13 12:52:24 +00:00
lda MLI.PATHBUF
tay
clc
adc IO.LINEBUF+1
cmp #$40
tax
2022-03-13 12:52:24 +00:00
lda #$10
bcs LA8F5
stx MLI.PATHBUF
LA8D9 dex
dey
bmi LA8E6
2022-03-13 12:52:24 +00:00
lda MLI.PATHBUF+1,y
sta MLI.PATHBUF+1,x
jmp LA8D9
2022-03-13 12:52:24 +00:00
LA8E6 lda #$2F
sta MLI.PATHBUF+1
LA8EB sta MLI.PATHBUF+1,x
2022-03-13 12:52:24 +00:00
lda IO.LINEBUF,x
dex
bne LA8EB
LA8F4 clc
LA8F5 rts
LA8F6 jsr BS.TMPBUF3Reset
ldy #$09
2022-03-13 12:52:24 +00:00
jsr BS.ToUpper
LA8FB cmp BS.KW.OPT,y
beq LA935
dey
bpl LA8FB
2022-03-13 12:52:24 +00:00
cmp #'T'
beq LA90A
LA907 jmp BS.ERR10
2022-03-13 12:52:24 +00:00
LA90A lda #$04
and GP.AllowedBITS
beq LA931
2022-03-15 19:33:19 +00:00
tsb GP.FoundBITS
2022-03-13 12:52:24 +00:00
stz XBC08
lda #$12
sta XBC09
jsr BS.GetCharSpaceSep
beq LA907
cmp #$24
beq LA984
cmp #$41
bcc LA96E
jmp BS.GetFTypeASC
LA931 sec
2022-03-13 12:52:24 +00:00
lda #$0B
rts
2022-03-13 12:52:24 +00:00
LA935 lda BS.KW.OPT.PBITSLO,y
beq LA955
and GP.AllowedBITS+1
beq LA931
cmp #$04
bne LA94F
and GP.FoundBITS+1
bne LA955
2022-03-13 12:52:24 +00:00
lda #$01
sta GP.ParamD
2022-03-13 12:52:24 +00:00
lda #$04
2022-03-15 19:33:19 +00:00
LA94F tsb GP.FoundBITS+1
2022-03-13 12:52:24 +00:00
LA955 lda BS.KW.OPT.PBITSHI,y
and #$03
sta XBC08
2022-03-13 12:52:24 +00:00
lda BS.KW.OPT.PBITSHI,y
lsr
lsr
sta XBC09
jsr BS.GetCharSpaceSep
beq LA9BE
cmp #$24
beq LA984
LA96E stx GP.INPTR
2022-03-13 12:52:24 +00:00
jsr BS.GetDecDigit
bcc LA97A
bmi LA9C1
bcs LA9BE
LA97A ldx GP.INPTR
jsr BS.GetCharSpaceSep
bne LA96E
beq LA99D
LA984 jsr BS.GetCharSpaceSep
beq LA9BE
LA989 stx GP.INPTR
2022-03-13 12:52:24 +00:00
jsr BS.GetHexDigit
bcc LA995
bmi LA9C1
bcs LA9BE
LA995 ldx GP.INPTR
jsr BS.GetCharSpaceSep
bne LA989
LA99D ldx #$02
LA99F cpx XBC08
beq LA9AC
2022-03-13 12:52:24 +00:00
lda BS.TMPBUF4,x
bne LA9C1
dex
bne LA99F
LA9AC ldy XBC09
2022-03-13 12:52:24 +00:00
LA9AF lda BS.TMPBUF4,x
sta GP.ParamA,y
dey
dex
bpl LA9AF
ldx GP.INPTR
clc
rts
LA9BE jmp BS.ERR10
LA9C1 jmp LA76C
BS.GetFTypeASC ldy #$00
LA9C6 sta BS.TMPBUF4,y
iny
cpy #$03
beq LA9D5
jsr BS.GetCharSpaceSep
bne LA9C6
beq LA9BE
LA9D5 stx GP.INPTR
LA9D8 ldx #$00
2022-03-13 12:52:24 +00:00
lda XBC08
cmp #$0F
beq LA9BE
asl
adc XBC08
tay
2022-03-13 12:52:24 +00:00
LA9E6 lda BS.TMPBUF4,x
eor BS.PRODOSTYPES.ASC,y
asl
bne LA9F7
iny
inx
cpx #$03
bne LA9E6
beq LA9FC
LA9F7 inc XBC08
bne LA9D8
2022-03-13 12:52:24 +00:00
LA9FC lda #$0E
sec
sbc XBC08
tay
2022-03-13 12:52:24 +00:00
lda BS.PRODOSTYPES.H,y
sta GP.ParamT
ldx GP.INPTR
clc
rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.GetPathInPathBuf
2022-03-13 12:52:24 +00:00
jsr BS.GetChar UC
sta MLI.PATHBUF,y
iny
cmp #$2C
beq LAA45
cmp #$20
beq LAA45
cmp #$0D
beq LAA56
cpy BS.GetCharMax
bcc BS.GetPathInPathBuf
ora #$00
rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.GetKWInCmdBuf
ldx #$00
ldy #$00
2022-03-13 12:52:24 +00:00
LAA2D jsr BS.GetChar UC
sta BS.CMDBUF,y
iny
2022-03-13 12:52:24 +00:00
cmp #','
beq LAA45
cmp #$20
beq LAA45
cmp #$0D
beq LAA56
cpy BS.GetCharMax
bcc LAA2D
LAA45 ora #$00
rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.GetCharSpaceSep
2022-03-13 12:52:24 +00:00
lda #$20
sta BS.GetCharSep
2022-03-13 12:52:24 +00:00
jsr BS.GetChar UC
cmp #','
beq LAA57
cmp #$0D
LAA56 clc
LAA57 rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.GetCharUC lda IO.LINEBUF,x
and #$7F
cmp #$61
2022-03-13 12:52:24 +00:00
bcc .1
and #$5F
2022-03-13 12:52:24 +00:00
.1 inx
cmp BS.GetCharSep
beq BS.GetCharUC
rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.GetChar lda IO.LINEBUF,x
and #$7F
2022-03-13 12:52:24 +00:00
inx
cmp BS.GetCharSep
beq BS.GetChar
rts
*--------------------------------------
BS.GetDecDigit cmp #$30
bcc LAA72
cmp #$3A
bcc LAA76
LAA72 sec
ora #$00
rts
LAA76 and #$0F
pha
2022-03-13 12:52:24 +00:00
lda BS.TMPBUF4+2
cmp #$1A
bcs LAAA2
ldx #$02
2022-03-13 12:52:24 +00:00
LAA82 lda BS.TMPBUF4,x
pha
dex
bpl LAA82
jsr BS.TMPBUF3x2
jsr BS.TMPBUF3x2
ldx #$00
clc
LAA92 pla
adc BS.TMPBUF4,x
sta BS.TMPBUF4,x
inx
txa
eor #$03
bne LAA92
jsr BS.TMPBUF3x2
LAAA2 pla
bcs LAAB8
adc BS.TMPBUF4
sta BS.TMPBUF4
bcc LAABB
clc
inc BS.TMPBUF4+1
bne LAABB
inc BS.TMPBUF4+2
bne LAABB
2022-03-13 12:52:24 +00:00
LAAB8 lda #$FF
sec
LAABB rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.GetHexDigit cmp #$30
bcc LAACC
cmp #$3A
bcc LAAD2
cmp #$41
bcc LAACC
cmp #$47
bcc LAAD0
LAACC sec
ora #$00
rts
LAAD0 sbc #$06
2022-03-13 12:52:24 +00:00
LAAD2 and #$0F
ldx #$03
LAAD6 jsr BS.TMPBUF3x2
bcs LAAB8
dex
bpl LAAD6
ora BS.TMPBUF4
sta BS.TMPBUF4
rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.TMPBUF3x2 asl BS.TMPBUF4
rol BS.TMPBUF4+1
rol BS.TMPBUF4+2
rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.IsIntCmd ldx #$1F
stx GP.XCNUM
2022-03-13 12:52:24 +00:00
lda BS.CMDBUF
eor #'-'
bne LAB03
inc GP.XCNUM
sta GP.XLEN
bne LAB20
LAB03 ldy #$08
sty GP.XLEN
2022-03-15 19:33:19 +00:00
LAB08 lda BS.KW.LEN-1,x
bpl LAB13
and #$7F
dey
dec GP.XLEN
LAB13 tax
2022-03-13 12:52:24 +00:00
LAB14 lda BS.CMDBUF,y
jsr BS.ToUpper
cmp BS.KW.TABLE,x
bne LAB33
dex
dey
bpl LAB14
2022-03-13 12:52:24 +00:00
LAB20 lda GP.XCNUM
asl
tax
2022-03-13 12:52:24 +00:00
lda BS.KW.PBITS-1,x
sta GP.AllowedBITS+1
2022-03-13 12:52:24 +00:00
lda BS.KW.PBITS-2,x
sta GP.AllowedBITS
clc
rts
LAB33 ldy GP.XLEN
dec GP.XCNUM
ldx GP.XCNUM
bne LAB08
dec GP.XCNUM
sec
jmp GP.EXTRNCMD
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.TMPBUF3Reset stz BS.TMPBUF4
stz BS.TMPBUF4+1
stz BS.TMPBUF4+2
rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.KW.APPEND lda GP.FITYPE
cmp #$FC
2022-03-13 12:52:24 +00:00
beq BS.KW.RUN
cmp #$06
beq LABA3
cmp #$04
bne LAB63
jmp BS.KW.EXEC
LAB63 cmp #$FF
beq LAB6F
2022-03-15 19:33:19 +00:00
cmp #$B3
beq LAB6F
2022-03-15 19:33:19 +00:00
2022-03-13 12:52:24 +00:00
lda #$0D
sec
rts
LAB6F pha
jsr LB562
jsr LB36B
2022-03-13 12:52:24 +00:00
stz GP.ParamA
stz MLI.MEMTABL+19
stz MLI.MEMTABL+20
stz MLI.MEMTABL+21
stz MLI.MEMTABL+22
lda #$01
sta MLI.MEMTABL+23
2022-03-13 12:52:24 +00:00
lda #$20
sta GP.ParamA+1
pla
cmp #$FF
bne LABA6
sta GP.ParamT
2022-03-13 12:52:24 +00:00
lda #$80
sta GP.FoundBITS+1
2022-03-13 12:52:24 +00:00
lda #$05
sta GP.FoundBITS
LABA3 jmp BS.KW.BRUN
LABA6 sec
jsr MON.IIGSID
bcs LABA3
2022-03-13 12:52:24 +00:00
jmp BS.QUIT.IIgs
BS.KW.X05 jsr LA411
2022-03-13 12:52:24 +00:00
lda AS.HIMEM+1
sta BS.AS.HIMEMSave
ldx XBBEA
dex
stx AS.HIMEM+1
jsr LAC22
ldx BS.AS.HIMEMSave
stx AS.HIMEM+1
bcs LAC33
jsr AS.CLEAR1
jsr LA480
2022-03-13 12:52:24 +00:00
lda #$00
beq LABE6
2022-03-13 12:52:24 +00:00
BS.KW.RUN stz GP.IFILACTV
stz AS.ERRNUM
lda GP.FoundBITS
lsr
bcc LABF4
jsr LAC1D
bcs LAC33
jsr AS.CLEAR1
LABE6 sta AS.ERRFLG
jsr LACB6
jsr BS.SaveCSWKSW
jsr LABF4
jmp AS.NEXTSTMT
LABF4 jsr AS.NORMAL
2022-03-13 12:52:24 +00:00
lda #$A3
sta X9F65
2022-03-13 12:52:24 +00:00
lda #$FF
sta GP.XCNUM
sta ZP.PROMPT
ldx #$04
jsr BS.SetState
jmp BS.ERR10
BS.KW.RESTORE jsr LAC1D
bcs LAC33
BS.ENTRY jsr AS.CLEAR1
jsr BS.SetState0
2022-03-13 12:52:24 +00:00
lda #$00
sta ZP.CH
jmp AS.RESTART1
LAC1D jsr LB562
bcs LAC33
LAC22 jsr LAC34
bcs LAC33
sty AS.ARRAYSTART
sty AS.VARSTART
sty AS.ARRAYEND
stx AS.ARRAYSTART+1
stx AS.VARSTART+1
stx AS.ARRAYEND+1
LAC33 rts
2022-03-13 12:52:24 +00:00
LAC34 lda #$01
ldx #$FC
jsr BS.CheckFTypeXAccessA
bcs LAC33
2022-03-13 12:52:24 +00:00
lda #MLI.C.GETEOF
jsr GP.GOSYSTEM
bcs LAC33
2022-03-13 12:52:24 +00:00
lda AS.PGRMSTART
sta GP.MLIRW.DATAPTR
adc GP.SBUFADR
sta GP.ParamA
2022-03-13 12:52:24 +00:00
lda AS.PGRMSTART+1
sta GP.MLIRW.DATAPTR+1
adc GP.SBUFADR+1
sta GP.ParamA+1
bcs LAC5E
cmp AS.HIMEM+1
2022-03-13 12:52:24 +00:00
LAC5E lda #$0E
bcs LAC33
ldx GP.SBUFADR
ldy GP.SBUFADR+1
jsr BS.ReadXYBytes
bcs LAC33
2022-03-15 19:33:19 +00:00
jsr BS.MLIClose
bcs LAC33
jsr LAC80
ldx GP.ParamA+1
ldy GP.ParamA
stx AS.PGRMEND+1
sty AS.PGRMEND
rts
LAC80 sec
2022-03-13 12:52:24 +00:00
lda AS.PGRMSTART
sbc GP.FIAUXTYPE
sta ZP.A1L
2022-03-13 12:52:24 +00:00
lda AS.PGRMSTART+1
sbc GP.FIAUXTYPE+1
sta ZP.A1H
ora ZP.A1L
clc
beq LACD9
ldx AS.PGRMSTART
2022-03-13 12:52:24 +00:00
lda AS.PGRMSTART+1
LAC98 stx ZP.PCL
sta ZP.PCH
ldy #$01
2022-03-13 12:52:24 +00:00
lda (ZP.PCL),y
dey
ora (ZP.PCL),y
beq LACD9
2022-03-13 12:52:24 +00:00
lda (ZP.PCL),y
adc ZP.A1L
tax
sta (ZP.PCL),y
iny
2022-03-13 12:52:24 +00:00
lda (ZP.PCL),y
adc ZP.A1H
sta (ZP.PCL),y
clc
bcc LAC98
2022-03-13 12:52:24 +00:00
LACB6 lda GP.FoundBITS+1
and #$08
clc
beq LACD9
2022-03-13 12:52:24 +00:00
lda GP.ParamAT
sta AS.LINNUM
2022-03-13 12:52:24 +00:00
lda GP.ParamAT+1
sta AS.LINNUM+1
jsr AS.FINDLINE
clc
2022-03-13 12:52:24 +00:00
lda AS.LOWTR
adc #$FF
sta AS.TXTPTR
2022-03-13 12:52:24 +00:00
lda AS.LOWTR+1
adc #$FF
sta AS.TXTPTR+1
clc
LACD9 rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.KW.STORE bcc LACFE
2022-03-13 12:52:24 +00:00
lda #$FC
sta GP.ParamT
sta GP.FITYPE
2022-03-13 12:52:24 +00:00
lda #$C3
sta GP.FIACCESS
2022-03-13 12:52:24 +00:00
lda AS.PGRMSTART
sta GP.CRAUXTYPE
sta GP.FIAUXTYPE
2022-03-13 12:52:24 +00:00
lda AS.PGRMSTART+1
sta GP.CRAUXTYPE+1
sta GP.FIAUXTYPE+1
jsr BS.CreateFileOrDir
bcs LAD47
2022-03-13 12:52:24 +00:00
LACFE lda #$02
ldx #$FC
jsr BS.CheckFTypeXAccessA
bcs LAD47
2022-03-13 12:52:24 +00:00
lda AS.PGRMEND
sec
sbc AS.PGRMSTART
tax
2022-03-13 12:52:24 +00:00
* sta GP.SBUFADR
lda AS.PGRMEND+1
sbc AS.PGRMSTART+1
tay
2022-03-13 12:52:24 +00:00
* sta GP.SBUFADR+1
* lda #$00
* sta GP.SBUFADR+2
jsr BS.SetSBUFADRXY0
lda AS.PGRMSTART
sta GP.MLIRW.DATAPTR
2022-03-13 12:52:24 +00:00
lda AS.PGRMSTART+1
sta GP.MLIRW.DATAPTR+1
jsr BS.WriteXYBytes
bcs LAD47
2022-03-13 12:52:24 +00:00
lda #MLI.C.SETEOF
jsr GP.GOSYSTEM
bcs LAD47
2022-03-15 19:33:19 +00:00
jsr BS.MLIClose
bcs LAD47
2022-03-13 12:52:24 +00:00
lda AS.PGRMSTART+1
ldx AS.PGRMSTART
cmp GP.FIAUXTYPE+1
bne LAD48
cpx GP.FIAUXTYPE
clc
bne LAD48
LAD47 rts
LAD48 stx GP.FIAUXTYPE
sta GP.FIAUXTYPE+1
jmp BS.SetFileInfoNoDate
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.KW.CREATE stz GP.CRAUXTYPE
stz GP.CRAUXTYPE+1
2022-03-15 19:33:19 +00:00
2022-03-13 12:52:24 +00:00
lda GP.FoundBITS
and #CMDBITS0.T
bne BS.CreateFileOrDir
2022-03-13 12:52:24 +00:00
lda #$0F
sta GP.ParamT
BS.CreateFileOrDir
2022-03-13 12:52:24 +00:00
lda GP.EXECACTV
asl
2022-03-13 12:52:24 +00:00
lda #$00
adc GP.OPENCNT
cmp #$08
bcs LAD8D
2022-03-13 12:52:24 +00:00
lda GP.ParamT
sta GP.CRTYPE
ldx #$C3
ldy #$01
cmp #$0F
bne LAD82
ldy #$0D
LAD82 stx GP.CRACCESS
sty GP.CRSTTYPE
2022-03-13 12:52:24 +00:00
lda #MLI.C.CREATE
jmp GP.GOSYSTEM
2022-03-13 12:52:24 +00:00
LAD8D lda #$0C
rts
2022-03-15 19:33:19 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
BS.KW.RENAME lda GP.FoundBITS
lsr
lsr
2022-03-13 12:52:24 +00:00
lda #MLI.C.RENAME
bcs LAD9E
jmp BS.ERR10
2022-03-15 19:33:19 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
BS.KW.DELETE lda #MLI.C.DESTROY
LAD9E jmp GP.GOSYSTEM
2022-03-15 19:33:19 +00:00
*--------------------------------------
BS.KW.LOCK jsr BS.GetFileInfo
2022-03-13 12:52:24 +00:00
lda GP.FIACCESS
and #$3C
ora #$01
2022-03-15 19:33:19 +00:00
bra BS.KW.UNLOCK1
*--------------------------------------
BS.KW.UNLOCK jsr BS.GetFileInfo
2022-03-13 12:52:24 +00:00
lda #$C3
ora GP.FIACCESS
2022-03-15 19:33:19 +00:00
BS.KW.UNLOCK1 sta GP.FIACCESS
jmp BS.SetFileInfo
*--------------------------------------
2022-03-13 12:52:24 +00:00
BS.KW.PREFIX lda GP.FoundBITS+1
and #$04
sec
bne LADCB
2022-03-13 12:52:24 +00:00
lda GP.FoundBITS
lsr
2022-03-15 19:33:19 +00:00
LADCB lda #MLI.C.SETPREFIX
bcs LAD9E
2022-03-13 12:52:24 +00:00
lda ZP.PROMPT
beq LADF0
jsr BS.CROUT
ldx #$00
LADD8 cpx BS.CMDBUF.LEN
beq LADE8
2022-03-13 12:52:24 +00:00
lda BS.CMDBUF,x
ora #$80
jsr BS.COUT
inx
bne LADD8
LADE8 jsr BS.CROUT
jsr BS.CROUT
clc
rts
2022-03-15 19:33:19 +00:00
LADF0 sec
ror GP.PFXACTV
clc
rts
*--------------------------------------
MAN
SAVE usr/src/basic.fx/basic.s.b
LOAD usr/src/basic.fx/basic.s
ASM