mirror of
https://github.com/mist64/msbasic.git
synced 2025-09-11 05:28:08 +00:00
cleanup
This commit is contained in:
5
NOTES.txt
Normal file
5
NOTES.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Name Year MS Version ROM 9digit extensions
|
||||||
|
Commodore BASIC 1 1977 Y Y CBM
|
||||||
|
OSI BASIC 1977 1.0 REV 3.2 Y N -
|
||||||
|
KIM BASIC 1977 1.1 N Y -
|
||||||
|
Commodore BASIC 2 1979 Y Y CBM
|
@@ -1,4 +1,5 @@
|
|||||||
.ifdef CBM1
|
.ifdef CBM1
|
||||||
|
USR := $0000
|
||||||
Z00 := $0000
|
Z00 := $0000
|
||||||
L0001 := $0001
|
L0001 := $0001
|
||||||
L0002 := $0002
|
L0002 := $0002
|
||||||
@@ -81,6 +82,7 @@ TXTPTR := $00C9
|
|||||||
L00CF := $00CF
|
L00CF := $00CF
|
||||||
RNDSEED := $00DA
|
RNDSEED := $00DA
|
||||||
.else
|
.else
|
||||||
|
USR := $0000
|
||||||
Z00 := $0000
|
Z00 := $0000
|
||||||
L0001 := $0001
|
L0001 := $0001
|
||||||
L0002 := $0002
|
L0002 := $0002
|
||||||
|
18
make.sh
18
make.sh
@@ -1,4 +1,11 @@
|
|||||||
# 1.0
|
# 1.0
|
||||||
|
ca65 -D CBM -D CBM1 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-new.bin > cbmbasic1-new.bin.txt
|
||||||
|
diff -u cbmbasic1.bin.txt cbmbasic1-new.bin.txt | head
|
||||||
|
|
||||||
|
# 1.0 rev 3.2
|
||||||
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
|
||||||
@@ -6,21 +13,14 @@ 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
|
||||||
|
|
||||||
# 1.1
|
# 1.1
|
||||||
ca65 -D CBM -D CBM1 msbasic.s -o cbmbasic1.o &&
|
ca65 -D KIM -D CONFIG_11 msbasic.s -o kb9.o &&
|
||||||
ld65 -C cbmbasic.cfg cbmbasic1.o -o cbmbasic1-new.bin &&
|
|
||||||
xxd -g 1 cbmbasic1.bin > cbmbasic1.bin.txt
|
|
||||||
xxd -g 1 cbmbasic1-new.bin > cbmbasic1-new.bin.txt
|
|
||||||
diff -u cbmbasic1.bin.txt cbmbasic1-new.bin.txt | head
|
|
||||||
|
|
||||||
# 2
|
|
||||||
ca65 -D KIM -D CONFIG_2 msbasic.s -o kb9.o &&
|
|
||||||
ld65 -C kb9.cfg kb9.o -o kb9-new.bin &&
|
ld65 -C kb9.cfg kb9.o -o kb9-new.bin &&
|
||||||
xxd -g 1 kb9.bin > kb9.bin.txt
|
xxd -g 1 kb9.bin > kb9.bin.txt
|
||||||
xxd -g 1 kb9-new.bin > kb9-new.bin.txt
|
xxd -g 1 kb9-new.bin > kb9-new.bin.txt
|
||||||
diff -u kb9.bin.txt kb9-new.bin.txt | head
|
diff -u kb9.bin.txt kb9-new.bin.txt | head
|
||||||
|
|
||||||
# 2
|
# 2
|
||||||
ca65 -D CBM -D CBM2 -D CONFIG_2 msbasic.s -o cbmbasic2.o &&
|
ca65 -D CBM -D CBM2 -D CONFIG_11 msbasic.s -o cbmbasic2.o &&
|
||||||
ld65 -C cbmbasic.cfg cbmbasic2.o -o cbmbasic2-new.bin &&
|
ld65 -C cbmbasic.cfg cbmbasic2.o -o cbmbasic2-new.bin &&
|
||||||
xxd -g 1 cbmbasic2.bin > cbmbasic2.bin.txt
|
xxd -g 1 cbmbasic2.bin > cbmbasic2.bin.txt
|
||||||
xxd -g 1 cbmbasic2-new.bin > cbmbasic2-new.bin.txt
|
xxd -g 1 cbmbasic2-new.bin > cbmbasic2-new.bin.txt
|
||||||
|
82
msbasic.s
82
msbasic.s
@@ -71,14 +71,10 @@ UNFNC:
|
|||||||
.addr SGN
|
.addr SGN
|
||||||
.addr INT
|
.addr INT
|
||||||
.addr ABS
|
.addr ABS
|
||||||
.ifdef OSI
|
|
||||||
.addr USR
|
|
||||||
.endif
|
|
||||||
.ifdef KIM
|
.ifdef KIM
|
||||||
.addr IQERR
|
.addr IQERR
|
||||||
.endif
|
.else
|
||||||
.ifdef CBM
|
.addr USR
|
||||||
.addr Z00
|
|
||||||
.endif
|
.endif
|
||||||
.addr FRE
|
.addr FRE
|
||||||
.addr POS
|
.addr POS
|
||||||
@@ -488,7 +484,7 @@ L2351:
|
|||||||
stx TXTPTR
|
stx TXTPTR
|
||||||
sty TXTPTR+1
|
sty TXTPTR+1
|
||||||
jsr CHRGET
|
jsr CHRGET
|
||||||
.ifdef CONFIG_2
|
.ifdef CONFIG_11
|
||||||
tax
|
tax
|
||||||
.endif
|
.endif
|
||||||
beq L2351
|
beq L2351
|
||||||
@@ -894,7 +890,7 @@ SCRTCH:
|
|||||||
sta VARTAB+1
|
sta VARTAB+1
|
||||||
SETPTRS:
|
SETPTRS:
|
||||||
jsr STXTPT
|
jsr STXTPT
|
||||||
.ifdef CONFIG_2
|
.ifdef CONFIG_11
|
||||||
lda #$00
|
lda #$00
|
||||||
CLEAR:
|
CLEAR:
|
||||||
bne L256A
|
bne L256A
|
||||||
@@ -1014,7 +1010,7 @@ L25CE:
|
|||||||
LA519:
|
LA519:
|
||||||
.endif
|
.endif
|
||||||
iny
|
iny
|
||||||
.ifdef CONFIG_2
|
.ifdef CONFIG_11
|
||||||
beq L25E5
|
beq L25E5
|
||||||
.endif
|
.endif
|
||||||
lda (LOWTR),y
|
lda (LOWTR),y
|
||||||
@@ -1131,7 +1127,7 @@ LC6D4:
|
|||||||
ldy #$00
|
ldy #$00
|
||||||
L2683:
|
L2683:
|
||||||
lda (TXTPTR),y
|
lda (TXTPTR),y
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
beq LA5DC
|
beq LA5DC
|
||||||
cmp #$3A
|
cmp #$3A
|
||||||
beq NEWSTT2
|
beq NEWSTT2
|
||||||
@@ -1167,7 +1163,7 @@ NEWSTT2:
|
|||||||
jsr EXECUTE_STATEMENT
|
jsr EXECUTE_STATEMENT
|
||||||
jmp NEWSTT
|
jmp NEWSTT
|
||||||
EXECUTE_STATEMENT:
|
EXECUTE_STATEMENT:
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
beq RET1
|
beq RET1
|
||||||
sec
|
sec
|
||||||
.else
|
.else
|
||||||
@@ -1175,7 +1171,7 @@ EXECUTE_STATEMENT:
|
|||||||
.endif
|
.endif
|
||||||
EXECUTE_STATEMENT1:
|
EXECUTE_STATEMENT1:
|
||||||
sbc #$80
|
sbc #$80
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
bcs LA609
|
bcs LA609
|
||||||
jmp LET
|
jmp LET
|
||||||
LA609:
|
LA609:
|
||||||
@@ -1195,7 +1191,7 @@ LA609:
|
|||||||
lda TOKEN_ADDRESS_TABLE,y
|
lda TOKEN_ADDRESS_TABLE,y
|
||||||
pha
|
pha
|
||||||
jmp CHRGET
|
jmp CHRGET
|
||||||
.ifdef CONFIG_2
|
.ifdef CONFIG_11
|
||||||
LET1:
|
LET1:
|
||||||
jmp LET
|
jmp LET
|
||||||
COLON:
|
COLON:
|
||||||
@@ -1311,7 +1307,7 @@ NULL:
|
|||||||
L2739:
|
L2739:
|
||||||
jmp IQERR
|
jmp IQERR
|
||||||
.endif
|
.endif
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
CLEAR:
|
CLEAR:
|
||||||
bne RET1
|
bne RET1
|
||||||
jmp CLEARC
|
jmp CLEARC
|
||||||
@@ -1496,7 +1492,7 @@ L2866:
|
|||||||
beq L2852
|
beq L2852
|
||||||
iny
|
iny
|
||||||
cmp #$22
|
cmp #$22
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
beq L285E
|
beq L285E
|
||||||
bne L2866
|
bne L2866
|
||||||
.else
|
.else
|
||||||
@@ -1712,18 +1708,7 @@ L294D:
|
|||||||
sta STRNG1
|
sta STRNG1
|
||||||
sty STRNG1+1
|
sty STRNG1+1
|
||||||
jsr MOVINS
|
jsr MOVINS
|
||||||
.ifdef OSI
|
lda #FAC
|
||||||
lda #$AC
|
|
||||||
.endif
|
|
||||||
.ifdef KIM
|
|
||||||
lda #$AE
|
|
||||||
.endif
|
|
||||||
.ifdef CBM1
|
|
||||||
lda #$B0
|
|
||||||
.endif
|
|
||||||
.ifdef CBM2
|
|
||||||
lda #$5E
|
|
||||||
.endif
|
|
||||||
ldy #$00
|
ldy #$00
|
||||||
L2963:
|
L2963:
|
||||||
sta DSCPTR
|
sta DSCPTR
|
||||||
@@ -1805,14 +1790,8 @@ L29B9:
|
|||||||
ldy #$00
|
ldy #$00
|
||||||
sty INPUTBUFFER,x
|
sty INPUTBUFFER,x
|
||||||
.endif
|
.endif
|
||||||
.ifdef OSI
|
.ifndef CBM2
|
||||||
ldx #$12
|
ldx #LINNUM+1
|
||||||
.endif
|
|
||||||
.ifdef KIM
|
|
||||||
ldx #$1A
|
|
||||||
.endif
|
|
||||||
.ifdef CBM1
|
|
||||||
ldx #$09
|
|
||||||
.endif
|
.endif
|
||||||
.ifdef CBM
|
.ifdef CBM
|
||||||
lda Z03
|
lda Z03
|
||||||
@@ -1878,14 +1857,14 @@ L29EB:
|
|||||||
adc #$01
|
adc #$01
|
||||||
bne L2A08
|
bne L2A08
|
||||||
L29F5:
|
L29F5:
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
pha
|
pha
|
||||||
.else
|
.else
|
||||||
php
|
php
|
||||||
.endif
|
.endif
|
||||||
jsr GTBYTC
|
jsr GTBYTC
|
||||||
cmp #$29
|
cmp #$29
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
bne SYNERR4
|
bne SYNERR4
|
||||||
pla
|
pla
|
||||||
cmp #TOKEN_TAB
|
cmp #TOKEN_TAB
|
||||||
@@ -1904,21 +1883,21 @@ L29F5:
|
|||||||
txa
|
txa
|
||||||
sbc Z16
|
sbc Z16
|
||||||
bcc L2A0D
|
bcc L2A0D
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
beq L2A0D
|
beq L2A0D
|
||||||
.endif
|
.endif
|
||||||
L2A08:
|
L2A08:
|
||||||
tax
|
tax
|
||||||
.ifdef CONFIG_2
|
.ifdef CONFIG_11
|
||||||
L2A09:
|
L2A09:
|
||||||
inx
|
inx
|
||||||
.endif
|
.endif
|
||||||
L2A0A:
|
L2A0A:
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
jsr OUTSP
|
jsr OUTSP
|
||||||
.endif
|
.endif
|
||||||
dex
|
dex
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
bne L2A0A
|
bne L2A0A
|
||||||
.else
|
.else
|
||||||
bne L2A13
|
bne L2A13
|
||||||
@@ -1926,7 +1905,7 @@ L2A0A:
|
|||||||
L2A0D:
|
L2A0D:
|
||||||
jsr CHRGET
|
jsr CHRGET
|
||||||
jmp PRINT2
|
jmp PRINT2
|
||||||
.ifdef CONFIG_2
|
.ifdef CONFIG_11
|
||||||
L2A13:
|
L2A13:
|
||||||
jsr OUTSP
|
jsr OUTSP
|
||||||
bne L2A0A
|
bne L2A0A
|
||||||
@@ -2022,7 +2001,7 @@ L2A56:
|
|||||||
L2A59:
|
L2A59:
|
||||||
lda INPUTFLG
|
lda INPUTFLG
|
||||||
beq L2A6E
|
beq L2A6E
|
||||||
.ifdef CONFIG_2
|
.ifdef CONFIG_11
|
||||||
bmi L2A63
|
bmi L2A63
|
||||||
ldy #$FF
|
ldy #$FF
|
||||||
bne L2A67
|
bne L2A67
|
||||||
@@ -4090,7 +4069,7 @@ L353F:
|
|||||||
SUBSTRING_SETUP:
|
SUBSTRING_SETUP:
|
||||||
jsr CHKCLS
|
jsr CHKCLS
|
||||||
pla
|
pla
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
sta JMPADRS+1
|
sta JMPADRS+1
|
||||||
pla
|
pla
|
||||||
sta JMPADRS+2
|
sta JMPADRS+2
|
||||||
@@ -4107,7 +4086,7 @@ SUBSTRING_SETUP:
|
|||||||
sta DSCPTR
|
sta DSCPTR
|
||||||
pla
|
pla
|
||||||
sta DSCPTR+1
|
sta DSCPTR+1
|
||||||
.ifdef CONFIG_2
|
.ifdef CONFIG_11
|
||||||
lda TEMPX
|
lda TEMPX
|
||||||
pha
|
pha
|
||||||
tya
|
tya
|
||||||
@@ -4118,7 +4097,7 @@ SUBSTRING_SETUP:
|
|||||||
.ifndef CBM2
|
.ifndef CBM2
|
||||||
beq GOIQ
|
beq GOIQ
|
||||||
.endif
|
.endif
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
inc JMPADRS+1
|
inc JMPADRS+1
|
||||||
jmp (JMPADRS+1)
|
jmp (JMPADRS+1)
|
||||||
.else
|
.else
|
||||||
@@ -4140,7 +4119,7 @@ ASC:
|
|||||||
ldy #$00
|
ldy #$00
|
||||||
lda (INDEX),y
|
lda (INDEX),y
|
||||||
tay
|
tay
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
jmp SNGFLT1
|
jmp SNGFLT1
|
||||||
.else
|
.else
|
||||||
jmp SNGFLT
|
jmp SNGFLT
|
||||||
@@ -4698,7 +4677,7 @@ LOG2:
|
|||||||
FMULT:
|
FMULT:
|
||||||
jsr LOAD_ARG_FROM_YA
|
jsr LOAD_ARG_FROM_YA
|
||||||
FMULTT:
|
FMULTT:
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
beq L3903
|
beq L3903
|
||||||
.else
|
.else
|
||||||
bne L3876
|
bne L3876
|
||||||
@@ -6055,7 +6034,7 @@ L4058:
|
|||||||
.ifdef OSI
|
.ifdef OSI
|
||||||
.byte $80,$4F,$C7,$52
|
.byte $80,$4F,$C7,$52
|
||||||
.endif
|
.endif
|
||||||
.ifdef CONFIG_2
|
.ifdef CONFIG_11
|
||||||
.byte $80,$4F,$C7,$52,$58
|
.byte $80,$4F,$C7,$52,$58
|
||||||
.endif
|
.endif
|
||||||
.ifdef CBM1
|
.ifdef CBM1
|
||||||
@@ -6148,7 +6127,7 @@ L4098:
|
|||||||
.ifndef CBM2
|
.ifndef CBM2
|
||||||
sta Z15
|
sta Z15
|
||||||
.endif
|
.endif
|
||||||
.ifndef CONFIG_2
|
.ifndef CONFIG_11
|
||||||
sta Z16
|
sta Z16
|
||||||
.endif
|
.endif
|
||||||
pha
|
pha
|
||||||
@@ -6393,8 +6372,7 @@ QT_BYTES_FREE:
|
|||||||
.endif
|
.endif
|
||||||
QT_BASIC:
|
QT_BASIC:
|
||||||
.ifdef OSI
|
.ifdef OSI
|
||||||
.byte "OSI 6502 BASIC VERSION 1.0 REV "
|
.byte "OSI 6502 BASIC VERSION 1.0 REV 3.2"
|
||||||
.byte "3.2"
|
|
||||||
.endif
|
.endif
|
||||||
.ifdef KIM
|
.ifdef KIM
|
||||||
.byte "MOS TECH 6502 BASIC V1.1"
|
.byte "MOS TECH 6502 BASIC V1.1"
|
||||||
|
Reference in New Issue
Block a user