2021-04-08 20:30:18 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
KW.ADDINT
|
|
|
|
|
KW.APPEND
|
|
|
|
|
KW.BYTE
|
|
|
|
|
KW.CLEAR
|
|
|
|
|
KW.CLOCK
|
|
|
|
|
KW.CLOSE
|
|
|
|
|
KW.COPY
|
|
|
|
|
KW.CREATE
|
|
|
|
|
KW.ECHO
|
|
|
|
|
KW.EDIT
|
2021-05-09 12:39:40 +00:00
|
|
|
|
lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-04-15 14:03:04 +00:00
|
|
|
|
*KW.END
|
2021-04-08 20:30:18 +00:00
|
|
|
|
KW.FILL
|
|
|
|
|
KW.FLAG
|
|
|
|
|
KW.FOR
|
|
|
|
|
KW.FREE
|
2021-04-10 17:17:40 +00:00
|
|
|
|
lda #E.CSYN
|
|
|
|
|
sec
|
2021-04-08 20:30:18 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-07-09 13:54:42 +00:00
|
|
|
|
KW.GET jsr CORE.GetNextCharNB
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
jsr CORE.CreateOrGetVar
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
ldx #RT.GET.ID
|
|
|
|
|
jsr CODE.JSRRT
|
|
|
|
|
|
|
|
|
|
ldy ZPADDR
|
|
|
|
|
ldx ZPADDR+1
|
|
|
|
|
jsr CODE.LDYXI
|
|
|
|
|
|
|
|
|
|
ldx #RT.StrSet.ID
|
|
|
|
|
clc
|
2021-07-09 20:40:57 +00:00
|
|
|
|
jmp CODE.JSRRT
|
2021-07-09 13:54:42 +00:00
|
|
|
|
|
|
|
|
|
.9 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2021-04-15 14:03:04 +00:00
|
|
|
|
KW.GOSUB lda #$20 JSR abs
|
|
|
|
|
bra KW.GOTO1
|
2021-04-10 17:17:40 +00:00
|
|
|
|
*--------------------------------------
|
2021-04-15 14:03:04 +00:00
|
|
|
|
KW.GOTO lda #$4C JMP abs
|
|
|
|
|
|
|
|
|
|
KW.GOTO1 jsr CODE.EmitByte
|
2021-04-10 17:17:40 +00:00
|
|
|
|
jsr CORE.GetNextCharNB
|
2021-04-08 20:30:18 +00:00
|
|
|
|
bcs .90
|
|
|
|
|
|
2021-04-15 14:03:04 +00:00
|
|
|
|
jsr CORE.GetLabel
|
2021-04-10 17:17:40 +00:00
|
|
|
|
bcc .1
|
|
|
|
|
|
2021-04-15 14:03:04 +00:00
|
|
|
|
jsr CORE.AddFWRef
|
|
|
|
|
bcs .99
|
2021-04-10 17:17:40 +00:00
|
|
|
|
|
2021-04-15 14:03:04 +00:00
|
|
|
|
.1 lda ZPADDR
|
2021-04-08 20:30:18 +00:00
|
|
|
|
jsr CODE.EmitByte
|
|
|
|
|
lda ZPADDR+1
|
|
|
|
|
clc
|
2021-04-10 17:17:40 +00:00
|
|
|
|
jmp CODE.EmitByte
|
2021-04-08 20:30:18 +00:00
|
|
|
|
|
|
|
|
|
.90 lda #E.CSYN
|
2021-04-15 14:03:04 +00:00
|
|
|
|
|
|
|
|
|
.99 rts
|
2021-04-08 20:30:18 +00:00
|
|
|
|
*--------------------------------------
|
2021-07-13 16:52:04 +00:00
|
|
|
|
KW.HOME ldx #8 CLRSCR
|
|
|
|
|
jsr CODE.LDXI
|
|
|
|
|
|
|
|
|
|
ldx #RT.OUTX.ID
|
|
|
|
|
clc
|
|
|
|
|
jmp CODE.JSRRT
|
2021-04-15 20:52:08 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* IP exp THEN st1 ELSE st2
|
|
|
|
|
*--------------------------------------
|
2021-05-09 12:39:40 +00:00
|
|
|
|
KW.IF jsr EXP.Eval
|
2021-04-15 20:52:08 +00:00
|
|
|
|
|
2021-05-09 12:39:40 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda EXP.TYPE
|
|
|
|
|
bne .91
|
2021-04-15 20:52:08 +00:00
|
|
|
|
|
2021-05-09 12:39:40 +00:00
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.1 lda CCODE.TESTTRUE,x
|
|
|
|
|
jsr CODE.EmitByte
|
|
|
|
|
inx
|
|
|
|
|
cpx #CCODE.TESTTRUE.LEN
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
ldy pCCS
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda ZPCodeBufPtr+1
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda ZPCodeBufPtr
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda #KWID.IF
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
sty pCCS
|
|
|
|
|
|
|
|
|
|
lda ZPCodeBufPtr
|
|
|
|
|
clc
|
|
|
|
|
adc #2
|
|
|
|
|
sta ZPCodeBufPtr
|
|
|
|
|
bcc .8
|
|
|
|
|
|
|
|
|
|
inc ZPCodeBufPtr+1
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.90 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.91 lda #E.TMISMATCH
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
KW.ENDIF sec
|
|
|
|
|
.HS 90 BCC
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
KW.ELSE clc
|
|
|
|
|
|
|
|
|
|
ldy pCCS
|
|
|
|
|
lda (pData),y
|
|
|
|
|
eor #KWID.IF
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
lda (pData),y
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
lda (pData),y
|
|
|
|
|
sta ZPPtr1+1 ZPPtr1 = JMP if FALSE
|
|
|
|
|
|
|
|
|
|
bcs .5 ENDIF
|
|
|
|
|
|
|
|
|
|
lda #$4C JMP abs
|
|
|
|
|
jsr CODE.EmitByte
|
|
|
|
|
|
|
|
|
|
ldy pCCS
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda ZPCodeBufPtr
|
|
|
|
|
sta (pData),y
|
|
|
|
|
iny
|
|
|
|
|
lda ZPCodeBufPtr+1
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
lda ZPCodeBufPtr
|
|
|
|
|
clc
|
|
|
|
|
adc #2
|
|
|
|
|
sta ZPCodeBufPtr
|
|
|
|
|
bcc .1
|
|
|
|
|
|
|
|
|
|
inc ZPCodeBufPtr+1
|
|
|
|
|
|
|
|
|
|
.1 lda ZPCodeBufPtr
|
|
|
|
|
sta (ZPPtr1)
|
|
|
|
|
|
|
|
|
|
lda ZPCodeBufPtr+1
|
|
|
|
|
ldy #1
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.5 lda ZPCodeBufPtr
|
|
|
|
|
sta (ZPPtr1)
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda ZPCodeBufPtr+1
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
|
|
|
|
|
lda pCCS
|
|
|
|
|
clc
|
|
|
|
|
adc #3
|
|
|
|
|
sta pCCS
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #E.NOIF
|
2021-04-15 20:52:08 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-04-08 20:30:18 +00:00
|
|
|
|
KW.INFO
|
2021-07-05 19:15:15 +00:00
|
|
|
|
lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-07-13 16:52:04 +00:00
|
|
|
|
KW.INPUT stz hIn Defaut to Keyboard
|
|
|
|
|
|
|
|
|
|
jsr CORE.GetNextCharNB
|
2021-07-05 19:15:15 +00:00
|
|
|
|
bcs .9
|
2021-07-13 16:52:04 +00:00
|
|
|
|
|
|
|
|
|
cmp #'"'
|
|
|
|
|
bne .5
|
|
|
|
|
|
|
|
|
|
jsr EXP.CreateStrConst
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
ldx #RT.StrOut.ID
|
|
|
|
|
jsr CODE.JSRRT
|
2021-07-07 14:29:10 +00:00
|
|
|
|
|
2021-07-13 16:52:04 +00:00
|
|
|
|
.5 jsr CORE.CreateOrGetVar
|
2021-07-05 19:15:15 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2021-07-07 14:29:10 +00:00
|
|
|
|
ldx #RT.INPUT.ID
|
2021-07-05 19:15:15 +00:00
|
|
|
|
jsr CODE.JSRRT
|
2021-07-07 14:29:10 +00:00
|
|
|
|
|
2021-07-09 13:54:42 +00:00
|
|
|
|
ldy ZPADDR
|
|
|
|
|
ldx ZPADDR+1
|
|
|
|
|
jsr CODE.LDYXI
|
|
|
|
|
|
|
|
|
|
ldx #RT.StrSet.ID
|
2021-07-05 19:15:15 +00:00
|
|
|
|
clc
|
2021-07-09 20:40:57 +00:00
|
|
|
|
jmp CODE.JSRRT
|
2021-07-05 19:15:15 +00:00
|
|
|
|
|
|
|
|
|
.9 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2021-04-08 20:30:18 +00:00
|
|
|
|
KW.KILL
|
|
|
|
|
KW.LINK
|
|
|
|
|
KW.LOG
|
|
|
|
|
KW.MARK
|
|
|
|
|
KW.MODEM
|
|
|
|
|
KW.MOVE
|
|
|
|
|
KW.MSG
|
|
|
|
|
KW.NEXT
|
|
|
|
|
KW.NIBBLE
|
|
|
|
|
KW.NOT
|
|
|
|
|
KW.ON
|
2021-07-09 13:54:42 +00:00
|
|
|
|
KW.NOCAR >DEBUG
|
2021-06-03 17:43:28 +00:00
|
|
|
|
lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-04-08 20:30:18 +00:00
|
|
|
|
KW.OPEN
|
2021-06-03 17:43:28 +00:00
|
|
|
|
lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-04-08 20:30:18 +00:00
|
|
|
|
KW.POKE
|
|
|
|
|
KW.POP
|
|
|
|
|
KW.POSITION
|
2021-04-10 17:17:40 +00:00
|
|
|
|
lda #E.CSYN
|
|
|
|
|
sec
|
2021-04-08 20:30:18 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-07-13 16:52:04 +00:00
|
|
|
|
KW.PRINT stz ZPPtr2 put ending CR
|
|
|
|
|
stz hOut Default to screen
|
2021-04-08 20:30:18 +00:00
|
|
|
|
|
|
|
|
|
.10 jsr CORE.GetNextCharNB
|
|
|
|
|
bcs .8
|
|
|
|
|
|
2021-07-13 16:52:04 +00:00
|
|
|
|
.11 cmp #'\'
|
|
|
|
|
bne .13
|
|
|
|
|
|
|
|
|
|
.12 ldx #RT.OUTCRLF.ID
|
|
|
|
|
jsr CODE.JSRRT
|
|
|
|
|
bra .10
|
|
|
|
|
|
|
|
|
|
.13 jsr CORE.IsEndInst
|
2021-04-08 20:30:18 +00:00
|
|
|
|
bcs .8
|
2021-05-09 12:39:40 +00:00
|
|
|
|
|
|
|
|
|
jsr CORE.IsKW
|
|
|
|
|
bcc .8
|
2021-04-10 17:17:40 +00:00
|
|
|
|
|
2021-05-09 12:39:40 +00:00
|
|
|
|
stz ZPPtr2 put ending CR
|
|
|
|
|
|
|
|
|
|
jsr EXP.Eval
|
2021-04-08 20:30:18 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
lda EXP.TYPE
|
|
|
|
|
beq .6
|
2021-04-08 20:30:18 +00:00
|
|
|
|
|
2021-07-07 14:29:10 +00:00
|
|
|
|
ldx #RT.StrOut.ID
|
2021-04-29 11:56:34 +00:00
|
|
|
|
bra .7
|
|
|
|
|
|
2021-07-07 14:29:10 +00:00
|
|
|
|
.6 ldx #RT.IntOut.ID
|
|
|
|
|
.7 jsr CODE.JSRRT
|
2021-04-29 11:56:34 +00:00
|
|
|
|
*--------------------------------------
|
2021-07-07 14:29:10 +00:00
|
|
|
|
jsr CORE.GetCharNB
|
2021-04-08 20:30:18 +00:00
|
|
|
|
bcs .8
|
|
|
|
|
|
2021-07-13 16:52:04 +00:00
|
|
|
|
.70 cmp #'\'
|
|
|
|
|
beq .12
|
|
|
|
|
|
|
|
|
|
jsr CORE.IsEndInst
|
2021-04-08 20:30:18 +00:00
|
|
|
|
bcs .8
|
|
|
|
|
|
2021-05-09 12:39:40 +00:00
|
|
|
|
jsr CORE.IsKW
|
|
|
|
|
bcc .8
|
|
|
|
|
|
|
|
|
|
lda (ZPInputBufPtr)
|
2021-04-08 20:30:18 +00:00
|
|
|
|
cmp #','
|
|
|
|
|
bne .71
|
|
|
|
|
|
2021-04-10 17:17:40 +00:00
|
|
|
|
tax
|
|
|
|
|
jsr CODE.PutChar
|
2021-04-08 20:30:18 +00:00
|
|
|
|
|
|
|
|
|
bra .10 go skip
|
|
|
|
|
|
|
|
|
|
.71 cmp #';'
|
|
|
|
|
bne .90
|
2021-05-09 12:39:40 +00:00
|
|
|
|
|
|
|
|
|
ror ZPPtr2 suppress ending CR
|
2021-04-08 20:30:18 +00:00
|
|
|
|
|
|
|
|
|
jsr CORE.GetNextCharNB skip ;
|
2021-04-10 17:17:40 +00:00
|
|
|
|
bcc .11
|
2021-04-08 20:30:18 +00:00
|
|
|
|
|
2021-05-09 12:39:40 +00:00
|
|
|
|
.8 bit ZPPtr2
|
2021-04-10 17:17:40 +00:00
|
|
|
|
bmi .80
|
2021-04-08 20:30:18 +00:00
|
|
|
|
|
2021-07-13 16:52:04 +00:00
|
|
|
|
ldx #RT.OUTCRLF.ID
|
|
|
|
|
jsr CODE.JSRRT
|
2021-04-08 20:30:18 +00:00
|
|
|
|
|
|
|
|
|
.80 clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.90 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
KW.PUBLIC
|
|
|
|
|
KW.PUSH
|
|
|
|
|
KW.RAM
|
|
|
|
|
KW.RAM2
|
|
|
|
|
KW.READ
|
|
|
|
|
KW.READY
|
2021-04-10 17:17:40 +00:00
|
|
|
|
lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-04-15 14:03:04 +00:00
|
|
|
|
KW.RETURN
|
|
|
|
|
* TODO : check context
|
|
|
|
|
|
|
|
|
|
KW.END lda #$60 RTS
|
2021-04-10 17:17:40 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
jmp CODE.EmitByte
|
|
|
|
|
*--------------------------------------
|
2021-04-08 20:30:18 +00:00
|
|
|
|
KW.REWIND
|
|
|
|
|
KW.RIPCO
|
|
|
|
|
KW.SET
|
|
|
|
|
KW.SETINT
|
|
|
|
|
KW.TEXT
|
2021-05-22 21:05:12 +00:00
|
|
|
|
lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
KW.THEN ldy pCCS
|
|
|
|
|
lda (pData),y
|
|
|
|
|
eor #KWID.IF
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #E.NOIF
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-04-08 20:30:18 +00:00
|
|
|
|
KW.TONE
|
|
|
|
|
KW.UPDATE
|
|
|
|
|
KW.USE
|
|
|
|
|
KW.WHENd
|
|
|
|
|
KW.WRITE
|
2021-04-10 17:17:40 +00:00
|
|
|
|
lda #E.CSYN
|
|
|
|
|
sec
|
2021-04-08 20:30:18 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/bin/acos.s.kw
|
|
|
|
|
LOAD usr/src/bin/acos.s
|
|
|
|
|
ASM
|