diff --git a/c64/basic/commands/cmd_load_verify.s b/c64/basic/commands/cmd_load_verify.s index 048951b4..3121e960 100644 --- a/c64/basic/commands/cmd_load_verify.s +++ b/c64/basic/commands/cmd_load_verify.s @@ -65,7 +65,7 @@ cmd_load_no_error: // For VERIFY - this is it lda VERCKB - bne cmd_load_end + bne_16 basic_execute_statement // C64 BASIC apparently does not clear variables after a LOAD in the // middle of a program. For safety, we do. diff --git a/c64/basic/commands/cmd_print.s b/c64/basic/commands/cmd_print.s index d9fd8b16..eb37e79f 100644 --- a/c64/basic/commands/cmd_print.s +++ b/c64/basic/commands/cmd_print.s @@ -11,6 +11,7 @@ cmd_print: jsr end_of_statement_check bcs cmd_print_new_line + jsr fetch_character cmp #$3B // semicolon beq cmd_print_done @@ -45,7 +46,7 @@ cmd_print_string: cmd_print_float: // XXX probably we should also check INTFLG here - // XXX + // XXX provide implementation // FALLTROUGH @@ -74,4 +75,4 @@ cmd_print_new_line: cmd_print_done: - jmp basic_main_loop + jmp basic_execute_statement diff --git a/c64/basic/commands/cmd_save.s b/c64/basic/commands/cmd_save.s index 00a61f59..06b9228b 100644 --- a/c64/basic/commands/cmd_save.s +++ b/c64/basic/commands/cmd_save.s @@ -36,4 +36,4 @@ cmd_save: // The end - jmp basic_main_loop + jmp basic_execute_statement diff --git a/c64/basic/engine/ad9e.frmevl.s b/c64/basic/engine/ad9e.frmevl.s index be7fb23b..40062716 100644 --- a/c64/basic/engine/ad9e.frmevl.s +++ b/c64/basic/engine/ad9e.frmevl.s @@ -19,22 +19,53 @@ FRMEVL: - // XXX for now we just report dummy string + // Check if end of statement - lda #$FF - sta VALTYP + jsr end_of_statement_check + bcs_16 do_SYNTAX_error - lda #$0B - sta __FAC1 + 0 + // Search for opening quote - lda #dummy_text - sta __FAC1 + 2 + // FALLTROUGH + +FRMEVL_fetch_string: + + // Mark return value as a string, set initial length as 0 + + ldx #$FF + stx VALTYP + + inx + stx __FAC1 + 0 + + // Set pointer to start of the string + + ldx TXTPTR + 0 + stx __FAC1 + 1 + ldx TXTPTR + 1 + stx __FAC1 + 2 +!: + // Search for closing quote + + jsr fetch_character + cmp #$22 + beq FRMEVL_done + + inc __FAC1 + 0 + bne !- + + jmp do_STRING_TOO_LONG_error + +FRMEVL_fetch_float: + + // XXX implement this + + jmp do_SYNTAX_error + +FRMEVL_done: rts - -dummy_text: - - .text "LOREM IPSUM"