diff --git a/defines_cbm.s b/defines_cbm.s index d9a05f7..1a95aa6 100644 --- a/defines_cbm.s +++ b/defines_cbm.s @@ -175,8 +175,10 @@ RNDSEED := $00DA-82 BYTES_PER_FRAME := $12 .ifdef CBM1 SPACE_FOR_GOSUB := $36 +STACK_TOP := $FC .else SPACE_FOR_GOSUB := $3E +STACK_TOP := $FA .endif FOR_STACK1 := $0F FOR_STACK2 := $09 @@ -192,6 +194,8 @@ RAMSTART3 := $0400 TOKEN_GOTO := $89 TOKEN_GOSUB := $8D +TOKEN_REM := $8F +TOKEN_PRINT := $99 TOKEN_TAB := $A3 TOKEN_TO := $A4 TOKEN_FN := $A5 diff --git a/defines_kbd.s b/defines_kbd.s index 83559db..d72df8b 100644 --- a/defines_kbd.s +++ b/defines_kbd.s @@ -98,6 +98,7 @@ MONISCNTC := $FFF1 LOAD := $FFF4 SAVE := $FFF7 +STACK_TOP := $FE BYTES_PER_FRAME := $10 SPACE_FOR_GOSUB := $49 FOR_STACK1 := $0D @@ -114,6 +115,8 @@ CONST_MEMSIZ := $3FFF TOKEN_GOTO := $88 TOKEN_GOSUB := $8C +TOKEN_REM := $8E +TOKEN_PRINT := $97 TOKEN_TAB := $9D TOKEN_TO := $9E TOKEN_FN := $9F diff --git a/defines_kim.s b/defines_kim.s index a74cd4a..7201033 100644 --- a/defines_kim.s +++ b/defines_kim.s @@ -88,6 +88,7 @@ L1873 := $1873 MONRDKEY := $1E5A MONCOUT := $1EA0 +STACK_TOP := $FC BYTES_PER_FRAME := $12 SPACE_FOR_GOSUB := $36 TEMPST := $66 @@ -102,6 +103,8 @@ MANTISSA_BYTES := BYTES_FP-1 TOKEN_GOTO := $88 TOKEN_GOSUB := $8C +TOKEN_REM := $8E +TOKEN_PRINT := $97 TOKEN_TAB := $9D TOKEN_TO := $9E TOKEN_FN := $9F diff --git a/defines_osi.s b/defines_osi.s index c98fb52..0616fee 100644 --- a/defines_osi.s +++ b/defines_osi.s @@ -94,6 +94,7 @@ MONISCNTC := $FFF1 LOAD := $FFF4 SAVE := $FFF7 +STACK_TOP := $FC BYTES_PER_FRAME := $10 SPACE_FOR_GOSUB := $33 TEMPST := $68 @@ -110,6 +111,8 @@ RAMSTART3 := $0300 TOKEN_GOTO := $88 TOKEN_GOSUB := $8C +TOKEN_REM := $8E +TOKEN_PRINT := $97 TOKEN_TAB := $9C TOKEN_TO := $9D TOKEN_FN := $9E diff --git a/msbasic.s b/msbasic.s index 86345a0..f770c72 100644 --- a/msbasic.s +++ b/msbasic.s @@ -903,11 +903,7 @@ PARSE_INPUT_LINE: ldy #$04 sty DATAFLG L246C: -.ifdef CBM2 lda INPUTBUFFERX,x -.else - lda INPUTBUFFERX,x -.endif .ifdef CBM bpl LC49E cmp #$FF @@ -925,11 +921,7 @@ LC49E: bvs L24AC cmp #$3F bne L2484 -.ifdef CBM - lda #$99 -.else - lda #$97 -.endif + lda #TOKEN_PRINT bne L24AC L2484: cmp #$30 @@ -951,10 +943,8 @@ L2498: .ifdef KBD jsr LF42D .else -.ifdef CBM2 - lda $0200,x -.else - lda Z00,x + lda INPUTBUFFERX,x +.ifndef CBM2 cmp #$20 beq L2497 .endif @@ -982,19 +972,11 @@ L24BF: sta DATAFLG L24C1: sec -.ifdef CBM - sbc #$55 -.else - sbc #$54 -.endif + sbc #TOKEN_REM-':' bne L246C sta ENDCHR L24C8: -.ifdef CBM2 - lda $0200,x -.else - lda Z00,x -.endif + lda INPUTBUFFERX,x beq L24AC cmp ENDCHR beq L24AC @@ -1012,20 +994,14 @@ L24DB: bpl L24DB lda TOKEN_NAME_TABLE,y bne L2498 -.ifdef CBM2 - lda $0200,x -.else - lda Z00,x -.endif + lda INPUTBUFFERX,x bpl L24AA L24EA: sta INPUTBUFFER-3,y .ifdef CBM2_KBD dec TXTPTR+1 - lda #$FF -.else - lda #INPUTBUFFER-1 .endif + lda #