From eadced28b9ab9e2ac63a893cc81d17e262ed7fe1 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Mon, 8 Jun 2020 19:04:09 +0200 Subject: [PATCH] small size optimization in BASIC code --- c64/basic/engine/execute_line_statements.s | 27 +++++++++------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/c64/basic/engine/execute_line_statements.s b/c64/basic/engine/execute_line_statements.s index df512e35..374db0e5 100644 --- a/c64/basic/engine/execute_line_statements.s +++ b/c64/basic/engine/execute_line_statements.s @@ -29,14 +29,6 @@ execute_statements: // Not end of the line - it seems we actually have something to execute - cmp #$7F - bcc_16 do_SYNTAX_error // branch if not a token XXX here we should handle variable assignments - - cmp #$A6 - bcs execute_statements_extended - -execute_statements_run_token: - // Initialize temporary string stack - just about any statement might need it // XXX original C64 ROM initializes this during the startup too - not sure where to put this @@ -45,6 +37,14 @@ execute_statements_run_token: ldx #$19 stx TEMPPT + // Check if token is valid for execution + + cmp #$7F + bcc_16 do_SYNTAX_error // branch if not a token XXX here we should handle variable assignments + + cmp #$A6 + bcs execute_statements_extended + #if !HAS_OPCODES_65C02 // Get the jump table entry for it, push it on the stack, and then RTS to start it. @@ -70,16 +70,11 @@ execute_statements_run_token: execute_statements_extended: - cmp #$CB - bne !+ - - // 'GO' command has a strange token, after function tokens - - lda #$A7 - bne execute_statements_run_token -!: // XXX here is the place for possible extended BASIC command set + cmp #$CB + beq_16 cmd_go // 'GO' command has a strange token, it is placed after function tokens + jmp do_SYNTAX_error