fixed end of statement check
This commit is contained in:
1 parent
b9bf1251da
commit
a17f810d50
7 files changed
+46
-56
No files matched your search
@@ -8,7 +8,7 @@ cmd_print:
|
|||||||
|
|
||||||
// First check if we have anything to print
|
// First check if we have anything to print
|
||||||
|
|
||||||
jsr end_of_statement_check
|
jsr is_end_of_statement
|
||||||
bcs cmd_print_new_line_done
|
bcs cmd_print_new_line_done
|
||||||
|
|
||||||
jsr fetch_character
|
jsr fetch_character
|
||||||
@@ -76,7 +76,7 @@ cmd_print_next_arg:
|
|||||||
|
|
||||||
// Look for the next argument
|
// Look for the next argument
|
||||||
|
|
||||||
jsr end_of_statement_check
|
jsr is_end_of_statement
|
||||||
bcs cmd_print_new_line_done
|
bcs cmd_print_new_line_done
|
||||||
|
|
||||||
cmp #$2C // comma XXX on C64 behavior is more complicated, fix it
|
cmp #$2C // comma XXX on C64 behavior is more complicated, fix it
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ cmd_goto:
|
|||||||
// Reset line pointer to first line of program.
|
// Reset line pointer to first line of program.
|
||||||
jsr init_oldtxt
|
jsr init_oldtxt
|
||||||
|
|
||||||
jsr end_of_statement_check
|
jsr is_end_of_statement
|
||||||
bcs !+
|
bcs !+
|
||||||
|
|
||||||
jsr fetch_line_number
|
jsr fetch_line_number
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
cmd_sys:
|
cmd_sys:
|
||||||
|
|
||||||
jsr end_of_statement_check
|
jsr is_end_of_statement
|
||||||
bcc !+
|
bcc !+
|
||||||
|
|
||||||
// SYS requires an argument
|
// SYS requires an argument
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ helper_load_fetch_filename:
|
|||||||
|
|
||||||
// Check if end of statement
|
// Check if end of statement
|
||||||
|
|
||||||
jsr end_of_statement_check
|
jsr is_end_of_statement
|
||||||
bcs !+
|
bcs !+
|
||||||
|
|
||||||
// Call the expression parser, make sure it returned a string
|
// Call the expression parser, make sure it returned a string
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ FRMEVL_loop:
|
|||||||
|
|
||||||
// Check if end of statement, fetch the character
|
// Check if end of statement, fetch the character
|
||||||
|
|
||||||
jsr end_of_statement_check
|
jsr is_end_of_statement
|
||||||
bcs_16 do_SYNTAX_error
|
bcs_16 do_SYNTAX_error
|
||||||
jsr fetch_character
|
jsr fetch_character
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ FRMEVL_fetch_string:
|
|||||||
|
|
||||||
FRMEVL_got_value:
|
FRMEVL_got_value:
|
||||||
|
|
||||||
jsr end_of_statement_check
|
jsr is_end_of_statement
|
||||||
bcs FRMEVL_compute_all // compute the stack if expression ended
|
bcs FRMEVL_compute_all // compute the stack if expression ended
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
// #LAYOUT# STD * #TAKE
|
|
||||||
// #LAYOUT# * BASIC_0 #TAKE
|
|
||||||
// #LAYOUT# * * #IGNORE
|
|
||||||
|
|
||||||
//
|
|
||||||
// Check for end of statement, sets Carry if so. Injests all spaces.
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
end_of_statement_check:
|
|
||||||
|
|
||||||
// XXX consider optimized version for 46K/56K memory models
|
|
||||||
|
|
||||||
ldy #$00
|
|
||||||
|
|
||||||
#if CONFIG_MEMORY_MODEL_60K
|
|
||||||
ldx #<TXTPTR
|
|
||||||
jsr peek_under_roms
|
|
||||||
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
|
|
||||||
jsr peek_under_roms_via_TXTPTR
|
|
||||||
#else // CONFIG_MEMORY_MODEL_38K
|
|
||||||
lda (TXTPTR),y
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Injest any spaces
|
|
||||||
|
|
||||||
cmp #$20
|
|
||||||
bne !+
|
|
||||||
#if !HAS_OPCODES_65CE02
|
|
||||||
jsr consume_character
|
|
||||||
#else
|
|
||||||
inw TXTPTR
|
|
||||||
#endif
|
|
||||||
jmp end_of_statement_check
|
|
||||||
!:
|
|
||||||
cmp #$00
|
|
||||||
beq !+
|
|
||||||
cmp #$3A
|
|
||||||
beq !+
|
|
||||||
|
|
||||||
// Not end of statement
|
|
||||||
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
!:
|
|
||||||
// End of statement
|
|
||||||
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# * BASIC_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check for end of statement, sets Carry if so. Injests all spaces.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
is_end_of_statement:
|
||||||
|
|
||||||
|
jsr fetch_character_skip_spaces
|
||||||
|
|
||||||
|
cmp #$00
|
||||||
|
beq !+
|
||||||
|
cmp #$3A
|
||||||
|
beq !+
|
||||||
|
|
||||||
|
// Not end of statement
|
||||||
|
|
||||||
|
#if !HAS_OPCODES_65CE02
|
||||||
|
jsr unconsume_character
|
||||||
|
#else
|
||||||
|
dew TXTPTR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
!:
|
||||||
|
// End of statement
|
||||||
|
|
||||||
|
#if !HAS_OPCODES_65CE02
|
||||||
|
jsr unconsume_character
|
||||||
|
#else
|
||||||
|
dew TXTPTR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
sec
|
||||||
|
rts
|
||||||
Reference in new issue
Block a user