mirror of
https://github.com/mist64/msbasic.git
synced 2025-01-10 16:29:36 +00:00
.
This commit is contained in:
parent
e0e14c51d7
commit
8061532c87
254
defines_cbm.s
254
defines_cbm.s
@ -1,3 +1,4 @@
|
|||||||
|
.ifdef CBM1
|
||||||
Z00 := $0000
|
Z00 := $0000
|
||||||
L0001 := $0001
|
L0001 := $0001
|
||||||
L0002 := $0002
|
L0002 := $0002
|
||||||
@ -5,89 +6,167 @@ GOWARM := $0003
|
|||||||
Z03 := $0003 ; same
|
Z03 := $0003 ; same
|
||||||
GOSTROUT := $0006
|
GOSTROUT := $0006
|
||||||
GOGIVEAYF := $0008
|
GOGIVEAYF := $0008
|
||||||
|
CHARAC := $005A
|
||||||
CHARAC := $005A;
|
ENDCHR := $005B
|
||||||
ENDCHR := $005B;;
|
|
||||||
EOLPNTR := $005C
|
EOLPNTR := $005C
|
||||||
DIMFLG := $005D;;
|
DIMFLG := $005D
|
||||||
VALTYP := $005E;;
|
VALTYP := $005E
|
||||||
DATAFLG := $0060;;
|
DATAFLG := $0060
|
||||||
SUBFLG := $0061;;
|
SUBFLG := $0061
|
||||||
INPUTFLG := $0062;;
|
INPUTFLG := $0062
|
||||||
CPRMASK := $0063;;
|
CPRMASK := $0063
|
||||||
Z14 := $0064 ; Ctrl+O flag
|
Z14 := $0064 ; Ctrl+O flag
|
||||||
Z15 := $0004;;
|
Z15 := $0004
|
||||||
Z16 := $0005;;
|
Z16 := $0005
|
||||||
Z17 := $0006
|
Z17 := $0006
|
||||||
Z18 := $0007
|
Z18 := $0007
|
||||||
LINNUM := $0008;;
|
LINNUM := $0008
|
||||||
INPUTBUFFER := $000A
|
INPUTBUFFER := $000A
|
||||||
TEMPPT := $0065;;
|
TEMPPT := $0065
|
||||||
LASTPT := $0066;
|
LASTPT := $0066
|
||||||
INDEX := $0071;;
|
INDEX := $0071
|
||||||
DEST := $0073;
|
DEST := $0073
|
||||||
RESULT := $0075;
|
RESULT := $0075
|
||||||
RESULT_LAST := $0079;
|
RESULT_LAST := $0079
|
||||||
TXTTAB := $007A;
|
TXTTAB := $007A
|
||||||
VARTAB := $007C;
|
VARTAB := $007C
|
||||||
ARYTAB := $007E;
|
ARYTAB := $007E
|
||||||
STREND := $0080;;
|
STREND := $0080
|
||||||
FRETOP := $0082;;
|
FRETOP := $0082
|
||||||
FRESPC := $0084;
|
FRESPC := $0084
|
||||||
MEMSIZ := $0086;
|
MEMSIZ := $0086
|
||||||
CURLIN := $0088;
|
CURLIN := $0088
|
||||||
OLDLIN := $008A;
|
OLDLIN := $008A
|
||||||
OLDTEXT := $008C;
|
OLDTEXT := $008C
|
||||||
Z8C := $008E;
|
Z8C := $008E
|
||||||
DATPTR := $0090;
|
DATPTR := $0090
|
||||||
INPTR := $0092;
|
INPTR := $0092
|
||||||
VARNAM := $0094;
|
VARNAM := $0094
|
||||||
VARPNT := $0096;;
|
VARPNT := $0096
|
||||||
FORPNT := $0098;;
|
FORPNT := $0098
|
||||||
LASTOP := $009A;
|
LASTOP := $009A
|
||||||
CPRTYP := $009C;
|
CPRTYP := $009C
|
||||||
FNCNAM := $009D;
|
FNCNAM := $009D
|
||||||
TEMP3 := $009D; ; same
|
TEMP3 := $009D; ; same
|
||||||
DSCPTR := $009F;
|
DSCPTR := $009F
|
||||||
|
DSCLEN := $00A2
|
||||||
DSCLEN := $00A2;
|
JMPADRS := $00A3
|
||||||
JMPADRS := $00A3;
|
TEMPX := $00A4
|
||||||
TEMPX := $00A4;
|
ARGEXTENSION := $00A5 ; overlap with JMPADRS! (same on c64)
|
||||||
ARGEXTENSION := $00A5; ; overlap with JMPADRS! (same on c64)
|
TEMP1 := $00A6
|
||||||
TEMP1 := $00A6;;
|
HIGHDS := $00A7
|
||||||
HIGHDS := $00A7;;
|
HIGHTR := $00A9
|
||||||
HIGHTR := $00A9;;
|
TEMP2 := $00AB
|
||||||
TEMP2 := $00AB;
|
INDX := $00AC
|
||||||
INDX := $00AC;
|
TMPEXP := $00AC ; same
|
||||||
TMPEXP := $00AC; ; same
|
EXPON := $00AD
|
||||||
EXPON := $00AD;
|
LOWTR := $00AE ; $9D also EXPSGN
|
||||||
LOWTR := $00AE;; ; $9D also EXPSGN
|
EXPSGN := $00AF
|
||||||
EXPSGN := $00AF;;
|
FAC := $00B0
|
||||||
FAC := $00B0;
|
FAC_LAST := $00B4
|
||||||
FAC_LAST := $00B4;
|
FACSIGN := $00B5
|
||||||
FACSIGN := $00B5;
|
SERLEN := $00B6
|
||||||
SERLEN := $00B6;
|
SHIFTSIGNEXT := $00B7
|
||||||
SHIFTSIGNEXT := $00B7;
|
ARG := $00B8
|
||||||
ARG := $00B8;
|
ARG_LAST := $00BC
|
||||||
ARG_LAST := $00BC;
|
ARGSIGN := $00BD
|
||||||
ARGSIGN := $00BD;
|
STRNG1 := $00BE ; TODO: also SGNCPR
|
||||||
STRNG1 := $00BE; ; TODO: also SGNCPR
|
FACEXTENSION := $00BF
|
||||||
FACEXTENSION := $00BF;
|
STRNG2 := $00C0
|
||||||
STRNG2 := $00C0;
|
CHRGET := $00C2
|
||||||
CHRGET := $00C2;
|
CHRGOT := $00C8
|
||||||
CHRGOT := $00C8;
|
TXTPTR := $00C9
|
||||||
TXTPTR := $00C9;
|
L00CF := $00CF
|
||||||
|
RNDSEED := $00DA
|
||||||
RNDSEED := $00DA;
|
.else
|
||||||
|
Z00 := $0000
|
||||||
|
L0001 := $0001
|
||||||
|
L0002 := $0002
|
||||||
|
GOWARM := $0003
|
||||||
|
Z03 := $000E;3 ; same
|
||||||
|
GOSTROUT := $0006
|
||||||
|
GOGIVEAYF := $0008
|
||||||
|
CHARAC := $005A
|
||||||
|
ENDCHR := $005B
|
||||||
|
EOLPNTR := $005C
|
||||||
|
DIMFLG := $005D
|
||||||
|
VALTYP := $005E
|
||||||
|
DATAFLG := $0060
|
||||||
|
SUBFLG := $0061
|
||||||
|
INPUTFLG := $0062
|
||||||
|
CPRMASK := $0063
|
||||||
|
Z14 := $000D;64 ; Ctrl+O flag
|
||||||
|
Z15 := $0004
|
||||||
|
Z16 := $0005
|
||||||
|
Z17 := $0006
|
||||||
|
Z18 := $0007
|
||||||
|
LINNUM := $0008
|
||||||
|
INPUTBUFFER := $000A
|
||||||
|
TEMPPT := $0065-82
|
||||||
|
LASTPT := $0066-82
|
||||||
|
INDEX := $0071-82
|
||||||
|
DEST := $0073-82
|
||||||
|
RESULT := $0075-82
|
||||||
|
RESULT_LAST := $0079-82
|
||||||
|
TXTTAB := $007A-82
|
||||||
|
VARTAB := $007C-82
|
||||||
|
ARYTAB := $007E-82
|
||||||
|
STREND := $0080-82
|
||||||
|
FRETOP := $0082-82
|
||||||
|
FRESPC := $0084-82
|
||||||
|
MEMSIZ := $0086-82
|
||||||
|
CURLIN := $0088-82
|
||||||
|
OLDLIN := $008A-82
|
||||||
|
OLDTEXT := $008C-82
|
||||||
|
Z8C := $008E-82
|
||||||
|
DATPTR := $0090-82
|
||||||
|
INPTR := $0092-82
|
||||||
|
VARNAM := $0094-82
|
||||||
|
VARPNT := $0096-82
|
||||||
|
FORPNT := $0098-82
|
||||||
|
LASTOP := $009A-82
|
||||||
|
CPRTYP := $009C-82
|
||||||
|
FNCNAM := $009D-82
|
||||||
|
TEMP3 := $009D-82 ; same
|
||||||
|
DSCPTR := $009F-82
|
||||||
|
DSCLEN := $00A2-82
|
||||||
|
JMPADRS := $00A3-82
|
||||||
|
TEMPX := $00A4-82
|
||||||
|
ARGEXTENSION := $00A5-82 ; overlap with JMPADRS! (same on c64)
|
||||||
|
TEMP1 := $00A6-82
|
||||||
|
HIGHDS := $00A7-82
|
||||||
|
HIGHTR := $00A9-82
|
||||||
|
TEMP2 := $00AB-82
|
||||||
|
INDX := $00AC-82
|
||||||
|
TMPEXP := $00AC-82 ; same
|
||||||
|
EXPON := $00AD-82
|
||||||
|
LOWTR := $00AE-82 ; $9D also EXPSGN
|
||||||
|
EXPSGN := $00AF-82
|
||||||
|
FAC := $00B0-82
|
||||||
|
FAC_LAST := $00B4-82
|
||||||
|
FACSIGN := $00B5-82
|
||||||
|
SERLEN := $00B6-82
|
||||||
|
SHIFTSIGNEXT := $00B7-82
|
||||||
|
ARG := $00B8-82
|
||||||
|
ARG_LAST := $00BC-82
|
||||||
|
ARGSIGN := $00BD-82
|
||||||
|
STRNG1 := $00BE-82 ; TODO: also SGNCPR
|
||||||
|
FACEXTENSION := $00BF-82
|
||||||
|
STRNG2 := $00C0-82
|
||||||
|
CHRGET := $00C2-82
|
||||||
|
CHRGOT := $00C8-82
|
||||||
|
TXTPTR := $00C9-82
|
||||||
|
L00CF := $00CF-82
|
||||||
|
RNDSEED := $00DA-82
|
||||||
|
.endif
|
||||||
|
|
||||||
BYTES_PER_FRAME := $12
|
BYTES_PER_FRAME := $12
|
||||||
SPACE_FOR_GOSUB := $36
|
SPACE_FOR_GOSUB := $36
|
||||||
TEMPST := $68;;
|
TEMPST := $68
|
||||||
FOR_STACK1 := $0F
|
FOR_STACK1 := $0F
|
||||||
FOR_STACK2 := $09
|
FOR_STACK2 := $09
|
||||||
NUM_TOKENS := $23;;
|
NUM_TOKENS := $23
|
||||||
NULL_MAX := $0A;;
|
NULL_MAX := $0A
|
||||||
BYTES_PER_ELEMENT := 5
|
BYTES_PER_ELEMENT := 5
|
||||||
BYTES_PER_VARIABLE := 7
|
BYTES_PER_VARIABLE := 7
|
||||||
BYTES_FP := 5
|
BYTES_FP := 5
|
||||||
@ -96,24 +175,23 @@ MANTISSA_BYTES := BYTES_FP-1
|
|||||||
RAMSTART2 := $0400
|
RAMSTART2 := $0400
|
||||||
RAMSTART3 := $0400
|
RAMSTART3 := $0400
|
||||||
|
|
||||||
TOKEN_GOTO := $89;;
|
TOKEN_GOTO := $89
|
||||||
TOKEN_GOSUB := $8D;;
|
TOKEN_GOSUB := $8D
|
||||||
TOKEN_TAB := $A3;;
|
TOKEN_TAB := $A3
|
||||||
TOKEN_TO := $A4;;
|
TOKEN_TO := $A4
|
||||||
TOKEN_FN := $A5;;
|
TOKEN_FN := $A5
|
||||||
TOKEN_SPC := $A6;;
|
TOKEN_SPC := $A6
|
||||||
TOKEN_THEN := $A7;;
|
TOKEN_THEN := $A7
|
||||||
TOKEN_NOT := $A8;;
|
TOKEN_NOT := $A8
|
||||||
TOKEN_STEP := $A9;;
|
TOKEN_STEP := $A9
|
||||||
TOKEN_PLUS := $AA;;
|
TOKEN_PLUS := $AA
|
||||||
TOKEN_MINUS := $AB;;
|
TOKEN_MINUS := $AB
|
||||||
TOKEN_GREATER := $B1;;
|
TOKEN_GREATER := $B1
|
||||||
TOKEN_EQUAL := $B2;;
|
TOKEN_EQUAL := $B2
|
||||||
TOKEN_SGN := $B4;;
|
TOKEN_SGN := $B4
|
||||||
TOKEN_LEFTSTR := $C8;;
|
TOKEN_LEFTSTR := $C8
|
||||||
|
|
||||||
|
|
||||||
L00CF := $00CF
|
|
||||||
|
|
||||||
OPEN := $FFC0
|
OPEN := $FFC0
|
||||||
CLOSE := $FFC3
|
CLOSE := $FFC3
|
||||||
|
16
make.sh
16
make.sh
@ -1,17 +1,17 @@
|
|||||||
ca65 -D KIM -D CONFIG_11 msbasic.s -o kb9.o &&
|
|
||||||
ld65 -C kb9.cfg kb9.o -o kb9-new.bin &&
|
|
||||||
xxd -g 1 kb9.bin > kb9.bin.txt
|
|
||||||
xxd -g 1 kb9-new.bin > kb9-new.bin.txt
|
|
||||||
diff -u kb9.bin.txt kb9-new.bin.txt | head
|
|
||||||
|
|
||||||
ca65 -D OSI msbasic.s -o osi.o &&
|
ca65 -D OSI msbasic.s -o osi.o &&
|
||||||
ld65 -C osi.cfg osi.o -o osi-new.bin
|
ld65 -C osi.cfg osi.o -o osi-new.bin
|
||||||
xxd -g 1 osi.bin > osi.bin.txt
|
xxd -g 1 osi.bin > osi.bin.txt
|
||||||
xxd -g 1 osi-new.bin > osi-new.bin.txt
|
xxd -g 1 osi-new.bin > osi-new.bin.txt
|
||||||
diff -u osi.bin.txt osi-new.bin.txt | head
|
diff -u osi.bin.txt osi-new.bin.txt | head
|
||||||
|
|
||||||
ca65 -D CBM -D CBM1 -D CONFIG_11 msbasic.s -o cbmbasic1.o &&
|
ca65 -D KIM -D CONFIG_11 msbasic.s -o kb9.o &&
|
||||||
ld65 -C cbmbasic1.cfg cbmbasic1.o -o cbmbasic1-new.bin &&
|
ld65 -C kb9.cfg kb9.o -o kb9-new.bin &&
|
||||||
|
xxd -g 1 kb9.bin > kb9.bin.txt
|
||||||
|
xxd -g 1 kb9-new.bin > kb9-new.bin.txt
|
||||||
|
diff -u kb9.bin.txt kb9-new.bin.txt | head
|
||||||
|
|
||||||
|
ca65 -D CBM -D CBM1 -D CONFIG_11 msbasic.s -o cbmbasic1.o &&
|
||||||
|
ld65 -C cbmbasic.cfg cbmbasic1.o -o cbmbasic1-new.bin &&
|
||||||
xxd -g 1 cbmbasic1.bin > cbmbasic1.bin.txt
|
xxd -g 1 cbmbasic1.bin > cbmbasic1.bin.txt
|
||||||
xxd -g 1 cbmbasic1-new.bin > cbmbasic1-new.bin.txt
|
xxd -g 1 cbmbasic1-new.bin > cbmbasic1-new.bin.txt
|
||||||
diff -u cbmbasic1.bin.txt cbmbasic1-new.bin.txt | head
|
diff -u cbmbasic1.bin.txt cbmbasic1-new.bin.txt | head
|
||||||
|
10
msbasic.s
10
msbasic.s
@ -213,6 +213,9 @@ TOKEN_NAME_TABLE:
|
|||||||
htasc "LEFT$"
|
htasc "LEFT$"
|
||||||
htasc "RIGHT$"
|
htasc "RIGHT$"
|
||||||
htasc "MID$"
|
htasc "MID$"
|
||||||
|
.ifdef CBM2
|
||||||
|
htasc "GO"
|
||||||
|
.endif
|
||||||
.byte 0
|
.byte 0
|
||||||
ERROR_MESSAGES:
|
ERROR_MESSAGES:
|
||||||
.ifndef CONFIG_11
|
.ifndef CONFIG_11
|
||||||
@ -248,9 +251,12 @@ ERROR_MESSAGES:
|
|||||||
.define ERRSTR_ILLDIR "ILLEGAL DIRECT"
|
.define ERRSTR_ILLDIR "ILLEGAL DIRECT"
|
||||||
.define ERRSTR_BADTYPE "TYPE MISMATCH"
|
.define ERRSTR_BADTYPE "TYPE MISMATCH"
|
||||||
.define ERRSTR_STRLONG "STRING TOO LONG"
|
.define ERRSTR_STRLONG "STRING TOO LONG"
|
||||||
.ifdef CBM
|
.ifdef CBM1
|
||||||
.define ERRSTR_BADDATA "BAD DATA"
|
.define ERRSTR_BADDATA "BAD DATA"
|
||||||
.endif
|
.endif
|
||||||
|
.ifdef CBM2
|
||||||
|
.define ERRSTR_BADDATA "FILE DATA"
|
||||||
|
.endif
|
||||||
.define ERRSTR_FRMCPX "FORMULA TOO COMPLEX"
|
.define ERRSTR_FRMCPX "FORMULA TOO COMPLEX"
|
||||||
.define ERRSTR_CANTCONT "CAN'T CONTINUE"
|
.define ERRSTR_CANTCONT "CAN'T CONTINUE"
|
||||||
.define ERRSTR_UNDEFFN "UNDEF'D FUNCTION"
|
.define ERRSTR_UNDEFFN "UNDEF'D FUNCTION"
|
||||||
@ -266,7 +272,7 @@ ERR_NODATA := <(*-ERROR_MESSAGES)
|
|||||||
htasc ERRSTR_NODATA
|
htasc ERRSTR_NODATA
|
||||||
ERR_ILLQTY := <(*-ERROR_MESSAGES)
|
ERR_ILLQTY := <(*-ERROR_MESSAGES)
|
||||||
htasc ERRSTR_ILLQTY
|
htasc ERRSTR_ILLQTY
|
||||||
.ifdef CBM
|
.ifdef CBM1
|
||||||
.byte 0,0,0,0,0
|
.byte 0,0,0,0,0
|
||||||
.endif
|
.endif
|
||||||
ERR_OVERFLOW := <(*-ERROR_MESSAGES)
|
ERR_OVERFLOW := <(*-ERROR_MESSAGES)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user