From 3d5ff392b032fc316e7a24c917fc97db7a024b8e Mon Sep 17 00:00:00 2001 From: Michael Steil Date: Tue, 7 Oct 2008 09:18:22 +0000 Subject: [PATCH] . --- TODO.txt | 5 ++++ defines_cbm.s | 3 --- msbasic.s | 70 +++++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 68 insertions(+), 10 deletions(-) create mode 100644 TODO.txt diff --git a/TODO.txt b/TODO.txt new file mode 100644 index 0000000..683e8e7 --- /dev/null +++ b/TODO.txt @@ -0,0 +1,5 @@ +* split into files +* use linker magic to compile files separately +* use C enum for zero page +* convert messy init code into completely different + files without ifdefs (not much in common!) diff --git a/defines_cbm.s b/defines_cbm.s index e017a6c..32326ac 100644 --- a/defines_cbm.s +++ b/defines_cbm.s @@ -217,6 +217,3 @@ MONRDKEY := GETIN -L0011 := $AA -LC392 := $AAAAA -LC71E := $AAAAA diff --git a/msbasic.s b/msbasic.s index a2e2cf2..a9e238d 100644 --- a/msbasic.s +++ b/msbasic.s @@ -571,7 +571,7 @@ L23D6: sty HIGHDS+1 jsr BLTU .ifdef CBM2 - lda L0011 + lda $11 ldy $12 sta $01FE sty $01FF @@ -591,7 +591,7 @@ FIX_LINKS: jsr SETPTRS .ifdef CBM2 jsr LC442 - jmp $AAAA; XXX LC392 + jmp L2351 LC442: .endif lda TXTTAB @@ -800,7 +800,11 @@ L24C1: bne L246C sta ENDCHR L24C8: +.ifdef CBM2 + lda $0200,x +.else lda Z00,x +.endif beq L24AC cmp ENDCHR beq L24AC @@ -818,7 +822,11 @@ L24DB: bpl L24DB lda TOKEN_NAME_TABLE,y bne L2498 +.ifdef CBM2 + lda $0200,x +.else lda Z00,x +.endif bpl L24AA L24EA: sta INPUTBUFFER-3,y @@ -6067,6 +6075,12 @@ COLD_START2: lda #$38 sta Z18 .endif +.ifdef CBM2 + lda #$28 + sta $0F + lda #$1E + sta $10 +.endif .ifdef OSI ldx #GENERIC_CHRGET_END-GENERIC_CHRGET .else @@ -6077,25 +6091,37 @@ L4098: sta STRNG2+1,x dex bne L4098 +.ifdef CBM2 + lda #$03 + sta DSCLEN +.endif txa sta SHIFTSIGNEXT .ifdef CBM sta Z03 .endif sta LASTPT+1 +.ifndef CBM2 sta Z15 +.endif .ifndef CONFIG_2 sta Z16 .endif pha sta Z14 +.ifdef CBM2 + inx + stx $01FD + stx $01FC +.else lda #$03 sta DSCLEN -.ifndef CONFIG_2 +.ifndef KIM lda #$2C sta LINNUM+1 .endif jsr CRDO +.endif ldx #TEMPST stx TEMPPT .ifndef CBM @@ -6111,20 +6137,33 @@ L4098: tay bne L40EE .endif +.ifndef CBM2 lda #RAMSTART2 + .ifdef CBM2 + sta $28 + sty $29 +.endif sta LINNUM sty LINNUM+1 +.ifdef CBM2 + tay +.else ldy #$00 +.endif L40D7: inc LINNUM bne L40DD inc LINNUM+1 -.ifdef CBM +.ifdef CBM1 lda $09 cmp #$80 beq L40FA .endif +.ifdef CBM2 + bmi L40FA +.endif L40DD: lda #$92 sta (LINNUM),y @@ -6140,7 +6179,7 @@ L40DD: beq L40D7 bne L40FA .endif -.ifdef CONFIG_2 +.ifdef KIM bne L40FA beq L40D7 .endif @@ -6233,13 +6272,21 @@ L4183: tya sta (TXTTAB),y inc TXTTAB +.ifndef CBM2 bne L4192 inc TXTTAB+1 L4192: +.endif lda TXTTAB ldy TXTTAB+1 jsr REASON +.ifdef CBM2 + lda #QT_BASIC + jsr STROUT +.else jsr CRDO +.endif lda MEMSIZ sec sbc TXTTAB @@ -6293,6 +6340,10 @@ QT_BYTES_FREE: .ifndef CBM .byte $0D,$0A,$0D,$0A .endif +.ifdef CBM2 + .byte $0D,$00 +.endif +QT_BASIC: .ifdef OSI .byte "OSI 6502 BASIC VERSION 1.0 REV " .byte "3.2" @@ -6300,11 +6351,16 @@ QT_BYTES_FREE: .ifdef KIM .byte "MOS TECH 6502 BASIC V1.1" .endif -.ifdef CBM +.ifdef CBM1 .byte $13 .byte "*** COMMODORE BASIC ***" .byte $11,$11,$11,$00 -.else +.endif +.ifdef CBM2 + .byte "### COMMODORE BASIC ###" + .byte $0D,$0D,$00 +.endif +.ifndef CBM .byte $0D,$0A .byte "COPYRIGHT 1977 BY MICROSOFT CO." .byte $0D,$0A,$00