improved syntax checking in BASIC
This commit is contained in:
1 parent
2a597b59e2
commit
defd079b2e
14 files changed
+58
-21
No files matched your search
@@ -9,4 +9,4 @@ cmd_clr:
|
||||
|
||||
// CLR command does not stop execution (confirmed on a C64)
|
||||
|
||||
jmp execute_statements
|
||||
jmp end_of_statement
|
||||
@@ -52,7 +52,7 @@ cmd_load_no_error:
|
||||
// For VERIFY - this is it
|
||||
|
||||
lda VERCKB
|
||||
bne_16 execute_statements
|
||||
bne_16 end_of_statement
|
||||
|
||||
// C64 BASIC apparently does not clear variables after a LOAD in the
|
||||
// middle of a program. For safety, we do.
|
||||
|
||||
@@ -89,4 +89,6 @@ cmd_print_new_line_done:
|
||||
|
||||
cmd_print_done:
|
||||
|
||||
jmp execute_statements
|
||||
// Execute next statement
|
||||
|
||||
jmp end_of_statement
|
||||
@@ -9,4 +9,4 @@ cmd_restore:
|
||||
|
||||
// RESTORE command does not stop execution (confirmed on a C64)
|
||||
|
||||
jmp execute_statements
|
||||
jmp end_of_statement
|
||||
@@ -38,6 +38,6 @@ cmd_save_do: // entry point for BSAVE
|
||||
jsr JSAVE
|
||||
bcs_16 do_kernal_error
|
||||
|
||||
// The end
|
||||
// Execute next statement
|
||||
|
||||
jmp execute_statements
|
||||
jmp end_of_statement
|
||||
@@ -62,7 +62,7 @@ cmd_sys_setup_call:
|
||||
// Call the routine.
|
||||
jsr USRPOK
|
||||
|
||||
jmp execute_statements
|
||||
jmp end_of_statement
|
||||
|
||||
|
||||
//
|
||||
|
||||
@@ -37,6 +37,6 @@ cmd_bload:
|
||||
jsr JLOAD
|
||||
bcs_16 do_kernal_error
|
||||
|
||||
// XXX when number parsing is done, change to continue execution
|
||||
// Execute next statement
|
||||
|
||||
jmp shell_main_loop
|
||||
jmp end_of_statement
|
||||
@@ -7,4 +7,7 @@ cmd_clear:
|
||||
|
||||
jsr clear_screen
|
||||
|
||||
jmp execute_statements
|
||||
// Execute next statement
|
||||
|
||||
jmp end_of_statement
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
cmd_cold:
|
||||
|
||||
jsr helper_ask_if_sure
|
||||
bcs_16 execute_statements
|
||||
bcs_16 end_of_statement
|
||||
|
||||
jsr JCLALL // for extra safety
|
||||
jmp (vector_reset) // hardware CPU vector
|
||||
@@ -7,4 +7,7 @@ cmd_dispose:
|
||||
|
||||
jsr varstr_garbage_collect
|
||||
|
||||
jmp execute_statements
|
||||
// Execute next statement
|
||||
|
||||
jmp end_of_statement
|
||||
|
||||
@@ -46,6 +46,6 @@ cmd_merge_no_error:
|
||||
|
||||
jsr update_LINKPRG_VARTAB_do_clr
|
||||
|
||||
// XXX when number parsing is done, change to continue execution
|
||||
// Execute next statement
|
||||
|
||||
jmp shell_main_loop
|
||||
jmp end_of_statement
|
||||
@@ -20,8 +20,8 @@ cmd_fast:
|
||||
|
||||
lda #$41
|
||||
sta CPU_D6510
|
||||
jmp end_of_statement
|
||||
|
||||
jmp execute_statements
|
||||
|
||||
#elif CONFIG_MB_ULTIMATE_64
|
||||
|
||||
@@ -30,12 +30,12 @@ cmd_fast:
|
||||
cmd_slow:
|
||||
|
||||
sta SCPU_SPEED_NORMAL
|
||||
jmp execute_statements
|
||||
jmp end_of_statement
|
||||
|
||||
cmd_fast:
|
||||
|
||||
sta SCPU_SPEED_TURBO
|
||||
jmp execute_statements
|
||||
jmp end_of_statement
|
||||
|
||||
#elif CONFIG_PLATFORM_COMMODORE_64
|
||||
|
||||
@@ -60,8 +60,7 @@ cmd_fast:
|
||||
lda #$01
|
||||
!:
|
||||
sta VIC_CLKRATE
|
||||
|
||||
jmp execute_statements
|
||||
jmp end_of_statement
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Executes the next command - after previous got finished
|
||||
//
|
||||
|
||||
|
||||
end_of_statement:
|
||||
jsr fetch_character
|
||||
|
||||
cmp #$3A // check for colon
|
||||
beq end_of_statement_next
|
||||
|
||||
cmp #$00 // check for end of the line
|
||||
beq_16 execute_statements_end_of_line
|
||||
|
||||
cmp #$20 // check for space
|
||||
beq end_of_statement
|
||||
|
||||
// Unexpectyed character
|
||||
|
||||
jmp do_SYNTAX_error
|
||||
|
||||
end_of_statement_next:
|
||||
|
||||
// Go to next statement
|
||||
|
||||
// XXX this should be speed-optimized, so that no unconsume is necessary
|
||||
jsr unconsume_character
|
||||
jmp execute_statements
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
end_of_statement_check:
|
||||
|
||||
// XXX this can probably be size-optimized
|
||||
|
||||
ldy #$00
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
Reference in new issue
Block a user