A2osX/BASIC.FX/BASIC.S.A.txt

957 lines
14 KiB
Plaintext
Raw Normal View History

NEW
AUTO 3,1
*--------------------------------------
BS.ResetCSWKSW pha
2022-03-18 17:59:39 +00:00
phx
2022-04-03 21:25:00 +00:00
2022-03-18 17:59:39 +00:00
ldx #3
2022-04-03 21:25:00 +00:00
2022-03-18 17:59:39 +00:00
.1 lda GP.VECTOUT,x
sta ZP.CSW,x
dex
bpl .1
2022-04-03 21:25:00 +00:00
2022-03-18 17:59:39 +00:00
plx
pla
rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.SetState0 ldx #$00
jsr BS.SetState
2022-03-13 12:52:24 +00:00
lda ZP.KSW+1
cmp GP.VDOSI+1
beq BS.SetCSWKSW2VDOS
2022-03-13 12:52:24 +00:00
lda ZP.CSW+1
cmp GP.VDOSO+1
beq BS.SetCSWKSW2VDOS
bne BS.SaveCSWKSW
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.IO.OUT cmp X9F65
bne L9A54
stx GP.PREGX
tsx
2022-03-13 12:52:24 +00:00
lda $103,x
cmp #$12 From AS rom: TRACE
bne L9A6E
2022-03-13 12:52:24 +00:00
lda $104,x
cmp #$D8 jsr from $D810, then JSR MON.COUT
bne L9A6E
ldx #$04
jsr BS.SetState
2022-03-13 12:52:24 +00:00
lda X9F65
ldx GP.PREGX
jmp BS.JMP.GP.VSYSO
L9A54 cmp GP.CHRLAST
sta GP.CHRLAST
bne L9A74
cmp #$8D
bne L9A74
2022-03-13 12:52:24 +00:00
lda ZP.CH
bne L9A69
2022-03-13 12:52:24 +00:00
lda BS.CMDBUF
cmp #$3F
2022-03-13 12:52:24 +00:00
L9A69 lda #$8D
bcs L9A74
rts
L9A6E ldx GP.PREGX
2022-03-13 12:52:24 +00:00
lda X9F65
L9A74 jsr BS.ResetCSWKSW
jsr MON.COUT
cmp #$8D
bne BS.SaveCSWKSW
2022-03-13 12:52:24 +00:00
lda AS.TRCFLG
cmp #$A5
beq L9A8B
sta GP.DTRACE
2022-03-13 12:52:24 +00:00
lda #$A5
sta AS.TRCFLG
2022-03-13 12:52:24 +00:00
L9A8B lda #$8D
BS.SaveCSWKSW pha
2022-03-18 17:59:39 +00:00
phx
2022-04-03 21:25:00 +00:00
2022-03-18 17:59:39 +00:00
ldx #3
.1 lda ZP.CSW,x
sta GP.VECTOUT,x
dex
bpl .1
2022-04-03 21:25:00 +00:00
2022-03-18 17:59:39 +00:00
plx
pla
BS.SetCSWKSW2VDOS
pha
2022-03-18 17:59:39 +00:00
phx
ldx #3
2022-04-03 21:25:00 +00:00
2022-03-18 17:59:39 +00:00
.1 lda GP.VDOSO,x
sta ZP.CSW,x
dex
bpl .1
2022-04-03 21:25:00 +00:00
2022-03-18 17:59:39 +00:00
plx
pla
rts
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.IO.IN bit GP.EXECACTV
2022-03-15 19:33:19 +00:00
bpl .1
jsr BS.SaveAXY
jmp BS.IO.IN.EXEC
2022-03-15 19:33:19 +00:00
.1 jsr BS.ResetCSWKSW
jsr MON.KEYIN0
cmp #$8D
2022-03-15 19:33:19 +00:00
beq .5
cmp #$88
beq .2
2022-04-03 21:25:00 +00:00
2022-03-15 19:33:19 +00:00
cmp #$FF
2022-03-18 17:59:39 +00:00
bne BS.SaveCSWKSW
.2 txa
2022-03-18 17:59:39 +00:00
beq BS.IO.IN.BS
2022-03-15 19:33:19 +00:00
.3 lda #$88
2022-03-15 19:33:19 +00:00
jsr MON.COUT
2022-03-18 17:59:39 +00:00
2022-03-15 19:33:19 +00:00
lda #$A0
jsr MON.COUT
2022-03-18 17:59:39 +00:00
bra BS.IO.IN.BS
2022-03-15 19:33:19 +00:00
.5 jsr BS.SaveAXY
sta IO.LINEBUF,x
BS.CheckDOSCMD jsr BS.DOSCMD
bit GP.XCNUM
bmi L9AE8
bcs BS.ERROUT
ldy GP.PREGY
ldx #$00
2022-03-18 17:59:39 +00:00
BS.IO.IN.BS lda #$88
bra BS.SaveCSWKSW
2022-03-18 17:59:39 +00:00
L9AE8 jsr BS.RestoreAXY
jmp BS.SaveCSWKSW
2022-03-15 19:33:19 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
BS.NODEVERR lda #$03
BS.ERROUT sta GP.ERRCODE
sta AS.ERRNUM
2022-03-13 12:52:24 +00:00
lda GP.STATE
cmp #$01
php
2022-03-13 12:52:24 +00:00
lda #$0F
sta MLI.LEVEL
2022-04-03 21:25:00 +00:00
2022-03-13 12:52:24 +00:00
stz GP.IFILACTV
stz GP.OFILACTV
stz GP.PFXACTV
stz GP.MLICF.REFNUM Close All
2022-03-13 12:52:24 +00:00
2022-03-15 19:33:19 +00:00
jsr BS.MLIClose
bcs L9B27
jsr LA004
bcs L9B27
2022-03-13 12:52:24 +00:00
stz MLI.LEVEL
stz GP.MLICF.REFNUM
lda #MLI.C.FLUSH
jsr GP.GOSYSTEM
L9B27 plp
ldx #$04
bit AS.ERRFLG
bcs L9B30
ldx #$00
L9B30 php
jsr BS.SetState
jsr BS.SetCSWKSW2VDOS
2022-03-13 12:52:24 +00:00
lda GP.ERRCODE
plp
bmi L9B4D
php
jsr GP.PRINTERR
jsr LB36B
plp
bcs L9B53
jsr MON.CROUT
jmp AS.RESTART1
L9B4D ldx AS.REMSTK
dex
dex
txs
tax
2022-03-13 12:52:24 +00:00
L9B53 lda #$03
jmp AS.BITERRFLG
2022-03-15 19:33:19 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
L9B58 stz AS.ERRNUM
lda #$A3
sta X9F65
jsr AS.NORMAL
jsr BS.ResetCSWKSW
jsr BS.WriteTBUF
jsr BS.SetState0
jsr BS.RestoreAXY
jmp BS.IO.IN
2022-03-15 19:33:19 +00:00
*--------------------------------------
BS.IO.IN0 jsr BS.SaveAXY
bit GP.PFXACTV
bpl L9B7E
2022-03-13 12:52:24 +00:00
jmp BS.IO.IN.CAT
L9B7E bit GP.IFILACTV
bpl L9B86
jmp BS.IO.IN.FILE
L9B86 bit GP.EXECACTV
bmi BS.IO.IN.EXEC
2022-03-13 12:52:24 +00:00
lda ZP.PROMPT
2022-03-18 17:59:39 +00:00
cmp #"]"
beq L9B58
jsr BS.ResetCSWKSW
2022-03-13 12:52:24 +00:00
L9B94 lda GP.PREGA
ldy GP.PREGY
jsr MON.KEYIN0
cmp #$88
bne L9BAC
2022-03-13 12:52:24 +00:00
lda ZP.PROMPT
2022-03-18 17:59:39 +00:00
cmp #">"
beq L9BAA
txa
beq L9B94
2022-03-13 12:52:24 +00:00
L9BAA lda #$88
L9BAC jmp BS.SaveCSWKSW
2022-03-15 19:33:19 +00:00
*--------------------------------------
BS.IO.IN.EXEC sta (ZP.BASL),y
2022-03-13 12:52:24 +00:00
lda ZP.PROMPT
2022-03-18 17:59:39 +00:00
cmp #">"
beq L9BF2
2022-03-13 12:52:24 +00:00
lda IO.KBD
bpl L9BCD
cmp #$83
bne L9BCD
jsr LB36B
2022-03-13 12:52:24 +00:00
lda GP.STATE
bne L9C01
sta IO.KSTROBE
beq L9C01
L9BCD jsr BS.Setup4readEFBytesAt200
jsr L9C6C
bcs L9BFA
jsr BS.SaveAXY
bcc L9BDE
L9BDA dex
2022-03-13 12:52:24 +00:00
lda IO.LINEBUF,x
L9BDE ora #$80
sta IO.LINEBUF,x
txa
bne L9BDA
jsr BS.ResetCSWKSW
jsr BS.CheckDOSCMD
bit GP.XCNUM
bpl L9BCD
L9BF1 rts
L9BF2 jsr BS.Setup4readEFBytesAt200
jsr BS.ReadOneByte
bcc L9BF1
L9BFA jsr LB2B5
cmp #$05
bne L9C13
L9C01 ldx #$00
ldy ZP.CH
bne L9C0E
2022-03-18 17:59:39 +00:00
lda #"]"
sta ZP.PROMPT
2022-03-13 12:52:24 +00:00
lda #$88
rts
2022-03-13 12:52:24 +00:00
L9C0E lda (ZP.BASL),y
jmp (ZP.KSW)
2022-03-13 12:52:24 +00:00
L9C13 jmp BS.ERROUT
2022-03-15 19:33:19 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
BS.IO.IN.FILE lda ZP.PROMPT
2022-03-18 17:59:39 +00:00
cmp #"]"
bne L9C1F
jmp L9B58
2022-03-13 12:52:24 +00:00
L9C1F lda GP.PREGA
sta (ZP.BASL),y
2022-03-13 12:52:24 +00:00
lda IO.KBD
bpl L9C31
cmp #$83
bne L9C31
bit IO.KSTROBE
rts
2022-03-13 12:52:24 +00:00
L9C31 lda ZP.PROMPT
bit GP.DIRFLG
bmi L9C95
2022-03-18 17:59:39 +00:00
cmp #">"
beq L9C42
jsr L9C67
bcs L9C13
rts
L9C42 jsr BS.ReadOneByte
bcs L9C13
rts
2022-03-15 19:33:19 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
BS.ReadOneByte lda GP.MLIRW.COUNT
sta GP.ParamL
2022-03-13 12:52:24 +00:00
lda #$01
sta GP.MLIRW.COUNT
jsr BS.MLIRead
bcs L9C66
2022-03-13 12:52:24 +00:00
lda GP.ParamL
sta GP.MLIRW.COUNT
ldx GP.MLIRW.DATAPTR
2022-03-13 12:52:24 +00:00
lda IO.LINEBUF,x
L9C66 rts
2022-03-15 19:33:19 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
L9C67 lda GP.PREGA
sta (ZP.BASL),y
L9C6C jsr BS.MLIRead
bcs L9C66
2022-03-13 12:52:24 +00:00
lda GP.MLIRW.TRANS
beq L9C8E
clc
adc GP.MLIRW.DATAPTR
tax
2022-03-13 12:52:24 +00:00
lda IO.LINEBUF-1,x
and #$7F
cmp #$0D
bne L9C8E
2022-03-13 12:52:24 +00:00
lda GP.FoundBITS+1
2022-04-03 21:25:00 +00:00
and #CMDBITS1.L
bne L9C8E
dex
2022-03-13 12:52:24 +00:00
L9C8E lda #$8D
ldy GP.PREGY
clc
rts
2022-03-18 17:59:39 +00:00
*--------------------------------------
L9C95 cmp #$BE
beq L9C8E
2022-03-13 12:52:24 +00:00
lda GP.PREGA
sta (ZP.BASL),y
2022-03-13 12:52:24 +00:00
lda #$4F
sta BS.CATWIDTH
jsr BS.MLIGetMark
bcs L9D1F
2022-03-13 12:52:24 +00:00
lda GP.SBUFADR
ora GP.SBUFADR+1
bne L9CDF
2022-03-13 12:52:24 +00:00
lda #$02
sta GP.CATFLAG
jsr BS.ReadDirEnt
bcs L9D1F
2022-03-13 12:52:24 +00:00
jsr BS.GetFTableIdx
2022-04-03 21:25:00 +00:00
lda BS.CAT.EL
sta BS.OpenFiles+1,x
lda BS.CAT.EPB
sta BS.OpenFiles+2,x
jsr BS.Filename2LineBuf
2022-03-13 12:52:24 +00:00
L9CD3 lda #$A2
sta IO.LINEBUF
2022-03-13 12:52:24 +00:00
lda #$8D
sta IO.LINEBUF,x
clc
rts
2022-03-13 12:52:24 +00:00
L9CDF lda GP.CATFLAG
beq L9D22
2022-03-13 12:52:24 +00:00
bmi L9CF9
2022-03-13 12:52:24 +00:00
ldx #$00
dec GP.CATFLAG
beq L9CD3
2022-03-13 12:52:24 +00:00
jsr BS.LINEBUFCLR80
2022-03-27 12:59:32 +00:00
ldy #$10
ldx #BSX.GetMSGY.X
jsr BS.ToAUX
L9CF5 ldx #$50
bne L9CD3
L9CF9 cmp #$FF
bne L9D1C
dec GP.CATFLAG
2022-04-03 21:25:00 +00:00
2022-03-13 12:52:24 +00:00
stz GP.MLIRW.COUNT
stz GP.MLIRW.COUNT+1
jsr BS.MLIRead
jsr BS.MkCatLineF
pha
2022-03-13 12:52:24 +00:00
lda GP.MLIRW.REFNUM
sta GP.MLIMRKEOFBUF.REFNUM
pla
bcc L9CF5
bcs L9D1F
2022-03-13 12:52:24 +00:00
L9D1C lda #$05
sec
L9D1F jmp BS.ERROUT
2022-03-13 12:52:24 +00:00
L9D22 lda #$FF
sta BS.CAT.EICB
2022-03-13 12:52:24 +00:00
jsr BS.GetFTableIdx
2022-04-03 21:25:00 +00:00
lda BS.OpenFiles+1,x
sta BS.CAT.EL
lda BS.OpenFiles+2,x
sta BS.CAT.EPB
2022-03-13 12:52:24 +00:00
lda GP.SBUFADR+1
and #$01
tax
2022-03-13 12:52:24 +00:00
lda GP.SBUFADR
sec
L9D45 inc BS.CAT.EICB
2022-04-03 21:25:00 +00:00
sbc BS.CAT.EL
bcs L9D45
dex
beq L9D45
jsr LB241
bcc L9D65
cmp #$02
beq L9D5D
cmp #$05
bne L9D1F
L9D5D dec GP.CATFLAG
ldx #$00
jmp L9CD3
L9D65 ldx #BSX.MkCatLine
jsr BS.ToAUX
jmp L9CF5
2022-03-15 19:33:19 +00:00
*--------------------------------------
BS.IO.IN.CAT cmp #$DD
bne L9D72
jmp L9B58
2022-03-13 12:52:24 +00:00
L9D72 lda GP.PREGA
sta (ZP.BASL),y
2022-04-03 21:25:00 +00:00
2022-03-13 12:52:24 +00:00
stz GP.PFXACTV
ldx BS.CMDBUF.LEN
2022-03-13 12:52:24 +00:00
L9D7F lda BS.CMDBUF.LEN,x
sta IO.LINEBUF-1,x
dex
bne L9D7F
ldx BS.CMDBUF.LEN
2022-03-13 12:52:24 +00:00
lda #$8D
rts
2022-03-15 19:33:19 +00:00
*--------------------------------------
BS.Setup4readEFBytesAt200
2022-04-03 21:25:00 +00:00
lda BS.REFNUM
sta GP.MLIRW.REFNUM
2022-03-13 12:52:24 +00:00
lda #$02
sta GP.MLIRW.DATAPTR+1
2022-03-13 12:52:24 +00:00
lda #$EF
sta GP.MLIRW.COUNT
2022-04-03 21:25:00 +00:00
2022-03-13 12:52:24 +00:00
stz GP.MLIRW.COUNT+1
stz GP.MLIRW.DATAPTR
rts
2022-03-15 19:33:19 +00:00
*--------------------------------------
BS.VSYSO jsr BS.SaveAXY
cmp #$84
bne .1
jsr BS.WriteTBUF
2022-03-15 19:33:19 +00:00
stz GP.INPTR
stz GP.IFILACTV
stz GP.OFILACTV
stz GP.PFXACTV
jmp BS.SetState8RestAXY
.1 jsr BS.SetState4RestAXY
jmp BS.JMP.GP.VSYSO
2022-03-15 19:33:19 +00:00
*--------------------------------------
BS.IO.OUT.CAT jsr BS.SaveAXY
ldx GP.INPTR
sta IO.LINEBUF,x
cmp #$8D
beq L9DEB
inc GP.INPTR
bne L9DE7
2022-03-13 12:52:24 +00:00
lda #$10
L9DE4 jmp BS.ERROUT
L9DE7 ldx GP.PREGX
rts
L9DEB inx
dex
beq BS.SetState4RestAXY
jsr BS.ResetCSWKSW
jsr BS.DOSCMD
bcs L9DE4
jsr BS.SaveCSWKSW
BS.SetState4RestAXY
ldx #$04
.HS 2C BIT ABS
BS.SetState8RestAXY
ldx #$08
jsr BS.SetState
jmp BS.RestoreAXY
L9E02 sty GP.PREGY
ldy ZP.PROMPT
beq L9E15
dey
beq L9E15
dey
beq L9E15
ldy GP.PREGY
jmp L9A74
L9E15 ldy GP.TBUFPTR
and #$7F
sta (AS.HIMEM),y
ldy GP.PREGY
inc GP.TBUFPTR
bne L9E2F
jsr BS.SaveAXY
jsr BS.WriteTBUF256
bcs L9DE4
jsr BS.RestoreAXY
L9E2F rts
2022-03-15 19:33:19 +00:00
*--------------------------------------
BS.IO.OUT.TRACE pha
stx GP.PREGX
tsx
2022-03-13 12:52:24 +00:00
lda $104,x
cmp #$12
bne L9E46
2022-03-13 12:52:24 +00:00
lda $105,x
cmp #$D8
bne L9E46
pla
bcs L9EBA
L9E46 pla
ldx GP.PREGX
bit GP.OFILACTV
bpl L9E70
cmp #$DD
bne L9E5A
cmp ZP.PROMPT
beq L9E8A
L9E5A cmp #$8D
bne L9E02
2022-03-13 12:52:24 +00:00
lda ZP.PROMPT
cmp #$FF
2022-03-13 12:52:24 +00:00
lda #$8D
bcc L9E02
jsr BS.WriteTBUF
sta GP.OFILACTV
2022-03-13 12:52:24 +00:00
lda #$8D
bne L9EA3
L9E70 pha
2022-03-13 12:52:24 +00:00
lda GP.IFILACTV
ora GP.PFXACTV
bpl L9E81
2022-03-13 12:52:24 +00:00
lda ZP.PROMPT
ora #$04
cmp #$84
beq L9EA6
L9E81 pla
cmp #$DD
bne L9EA3
cmp ZP.PROMPT
bne L9EA3
L9E8A jsr BS.SaveAXY
2022-03-13 12:52:24 +00:00
lda GP.OPENCNT
beq L9EA0
jsr BS.WriteTBUF
sta GP.OFILACTV
jsr BS.ResetCSWKSW
lda #BS.E.FSTILLOPEN
jsr GP.PRINTERR
L9EA0 jsr BS.RestoreAXY
L9EA3 jmp L9A74
L9EA6 pla
cmp #$8D
bne L9EAE
cmp GP.CHRLAST
L9EAE sta GP.CHRLAST
bne L9EB5
sta ZP.PROMPT
L9EB5 rts
L9EB6 inc AS.TXTPTR+1
bne L9EBE
L9EBA inc AS.TXTPTR
beq L9EB6
L9EBE ldx #$FF
stx ZP.PROMPT
ldx AS.REMSTK
txs
bit GP.DTRACE
bmi L9F3D
L9ECA ldy #$00
2022-03-13 12:52:24 +00:00
lda (AS.TXTPTR),y
bmi L9EF5
beq L9EF2
L9ED2 dec GP.STRINGS
bne L9EF0
2022-03-13 12:52:24 +00:00
lda AS.STRINGSTART+1
sbc AS.ARRAYEND+1
cmp #$03
bcs L9EE9
jsr BS.WriteTBUF
jsr BS.KW.FRE
2022-03-13 12:52:24 +00:00
lda AS.STRINGSTART+1
sbc AS.ARRAYEND+1
L9EE9 sta GP.STRINGS
ldy #$00
2022-03-13 12:52:24 +00:00
lda (AS.TXTPTR),y
L9EF0 cmp #$3A
L9EF2 jmp AS.EXECSTMT
L9EF5 sta ZP.PROMPT
tay
2022-03-15 19:33:19 +00:00
lda BS.AS.KW-$80,y
bmi L9EF2
sta X9F00+1
2022-03-15 19:33:19 +00:00
X9F00 bne BS.AS.KW0 SELF MODIFIED
BS.AS.KW0
BS.AS.KW.IF
BS.AS.KW.PRINT
2022-03-18 17:59:39 +00:00
stz ZP.PROMPT
stz GP.CHRLAST
2022-03-15 19:33:19 +00:00
lda #BS.VSYSO
sta GP.VSYSO
2022-03-15 19:33:19 +00:00
lda /BS.VSYSO
sta GP.VSYSO+1
bne L9F32
2022-03-15 19:33:19 +00:00
BS.AS.KW.LIST lda #$01
.HS 2C BIT ABS
BS.AS.KW.CALL lda #$02
sta ZP.PROMPT
bne L9F32
2022-03-15 19:33:19 +00:00
BS.AS.KW.LET tya
bra L9ED2
2022-03-15 19:33:19 +00:00
BS.AS.KW.TRACE sty GP.DTRACE
bne L9F2E
2022-03-15 19:33:19 +00:00
BS.AS.KW.NOTRACE
sta GP.DTRACE
dey
2022-03-13 12:52:24 +00:00
L9F2E lda #$4A
sta AS.TRCFLG
L9F32 tya
jmp AS.EXECSTMT
*--------------------------------------
2022-03-15 19:33:19 +00:00
BS.AS.KW.RESUME stz AS.ERRNUM
tya
bne L9EF0
L9F3D jsr BS.ResetCSWKSW
2022-03-13 12:52:24 +00:00
lda #$A3
jsr MON.COUT
ldx AS.CURLINE
2022-03-13 12:52:24 +00:00
lda AS.CURLINE+1
jsr AS.INTPRINTAX
2022-03-13 12:52:24 +00:00
lda #$A0
jsr MON.COUT
jsr BS.SaveCSWKSW
sec
jmp L9ECA
2022-03-15 19:33:19 +00:00
BS.AS.KW.FLASH
2022-03-13 12:52:24 +00:00
lda #$E3
.HS 2C BIT ABS
2022-03-15 19:33:19 +00:00
BS.AS.KW.NORMAL
BS.AS.KW.INVERSE
2022-03-13 12:52:24 +00:00
lda #$A3
L9F5E sta X9F65
tya
bne L9EF0
X9F65 .DA #$A3
2022-03-15 19:33:19 +00:00
*--------------------------------------
BS.SaveAXY sta GP.PREGA
stx GP.PREGX
sty GP.PREGY
rts
2022-03-15 19:33:19 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
BS.RestoreAXY lda GP.PREGA
ldx GP.PREGX
ldy GP.PREGY
rts
2022-03-15 19:33:19 +00:00
*--------------------------------------
BS.SetState stx GP.STATE
ldy #$00
2022-03-13 12:52:24 +00:00
.1 lda BS.SYSIOVECTS,x
sta GP.VSYSO,y
inx
iny
cpy #$04
2022-03-13 12:52:24 +00:00
bne .1
rts
2022-03-15 19:33:19 +00:00
*--------------------------------------
2022-03-27 12:59:32 +00:00
BS.PRINTERR ldx #BSX.GetErrA.X
.HS 2C BIT ABS
BS.GetMsgY ldx #BSX.GetMsgY.X
jsr BS.ToAUX
ldx GP.INPTR
stx BS.CATWIDTH
jsr MON.CROUT
2022-03-13 12:52:24 +00:00
lda #$87
jsr MON.COUT
BS.LINEBUFOUT ldx #$00
2022-03-13 12:52:24 +00:00
.1 lda IO.LINEBUF+1,x
jsr MON.COUT
inx
cpx BS.CATWIDTH
2022-03-13 12:52:24 +00:00
bcc .1
jmp MON.CROUT
2022-03-13 12:52:24 +00:00
*--------------------------------------
BS.WriteTBUF256 lda #$00
ldy #$01
2022-03-15 19:33:19 +00:00
bne BS.WriteTBUFAY
BS.WriteTBUF jsr LA004
bcc LA020
tay
pla
pla
tya
jmp BS.ERROUT
2022-03-15 19:33:19 +00:00
*--------------------------------------
LA004 ldy #$00
2022-03-13 12:52:24 +00:00
lda GP.TBUFPTR
2022-04-03 11:55:03 +00:00
clc
beq LA020
2022-03-15 19:33:19 +00:00
BS.WriteTBUFAY sta GP.MLIRW.COUNT
sty GP.MLIRW.COUNT+1
2022-04-03 21:25:00 +00:00
jsr BS.MLIWrite
2022-04-03 21:25:00 +00:00
2022-03-13 12:52:24 +00:00
stz GP.TBUFPTR
LA020 rts
2022-03-15 19:33:19 +00:00
*--------------------------------------
2022-05-25 18:46:02 +00:00
BS.FRE0 ldx #BSX.Fre0.X
.HS 2C BIT ABS
BS.KW.FRE
BS.FRE1 ldx #BSX.Fre0.X
2022-04-03 11:55:03 +00:00
2022-05-25 18:46:02 +00:00
ldy #13
2022-05-25 18:46:02 +00:00
.1 lda AS.PGRMSTART,y
sta ASX.PGRMSTART,y
dey
bpl .1
2022-05-25 18:46:02 +00:00
jsr BS.ToAUX
bcs .9
2022-05-25 18:46:02 +00:00
pha
phy
ldy #13
2022-05-25 18:46:02 +00:00
.2 lda ASX.PGRMSTART,y
sta AS.PGRMSTART,y
dey
bpl .2
2022-05-25 18:46:02 +00:00
ply
pla
2022-05-25 18:46:02 +00:00
.9 rts
2022-04-19 18:24:34 +00:00
*--------------------------------------
2022-05-25 18:46:02 +00:00
* DUPLICATE CODE in BASIC.S.XM.txt
2022-04-19 18:24:34 +00:00
*--------------------------------------
LA160 clc
2022-03-13 12:52:24 +00:00
lda XBBDC
sta ZP.A2L
stx ZP.A2H
eor AS.ARRAYEND
bne LA170
cpx AS.ARRAYEND+1
beq LA198
LA170 ldy #$02
2022-03-13 12:52:24 +00:00
lda (ZP.A2L),y
adc ZP.A2L
sta XBBDC
iny
2022-03-13 12:52:24 +00:00
lda (ZP.A2L),y
adc ZP.A2H
tax
ldy #$00
2022-03-13 12:52:24 +00:00
lda (ZP.A2L),y
iny
eor (ZP.A2L),y
bpl LA160
ldy #$04
2022-03-13 12:52:24 +00:00
lda (ZP.A2L),y
asl
adc #$05
adc ZP.A2L
sta ZP.A2L
bcc LA198
inc ZP.A2H
clc
LA198 rts
*--------------------------------------
MAN
SAVE usr/src/basic.fx/basic.s.a
LOAD usr/src/basic.fx/basic.s
ASM