more size optimizations in BASIC interpreter

This commit is contained in:
FeralChild64 committed 2020-07-09 22:58:15 +02:00
1 parent 4871abd79b
commit dbd8c77751
22 files changed
+67 -61

No files matched your search

+2 -2
View File
@@ -23,7 +23,7 @@
cmd_goto,
cmd_run,
cmd_if,
cmd_restore,
do_restore, // cmd_restore
cmd_gosub,
cmd_return,
cmd_rem,
@@ -42,7 +42,7 @@
cmd_print,
cmd_cont,
cmd_list,
cmd_clr,
do_clr, // cmd_clr
cmd_cmd,
cmd_sys,
cmd_open,
+2 -6
View File
@@ -3,10 +3,6 @@
// #LAYOUT# * * #IGNORE
cmd_clr:
// PLACEHOLDER for completeness - jumptable contains direct address
jsr do_clr
// CLR command does not stop execution (confirmed on a C64)
jmp end_of_statement
// CLR command does not stop execution (confirmed on a C64)
+1 -1
View File
@@ -31,7 +31,7 @@ list_loop:
// LIST terminates any running program,
// because it has fiddled with the current line pointer.
// (Confirmed by testing on a C64)
jmp shell_main_loop
jmp end_of_program
list_more_lines:
+4 -5
View File
@@ -74,10 +74,9 @@ cmd_load_no_error:
ldx CURLIN+1
inx
beq cmd_load_end // branch if direct mode
beq_16 end_of_program // branch if direct mode
pha
pha
jmp execute_line
cmd_load_end:
jmp shell_main_loop
+1 -1
View File
@@ -9,4 +9,4 @@ cmd_new:
// NEW command terminates execution (confirmed on a C64)
jmp shell_main_loop
jmp end_of_program
+1 -1
View File
@@ -91,4 +91,4 @@ cmd_print_done:
// Execute next statement
jmp end_of_statement
rts
+2
View File
@@ -7,4 +7,6 @@
cmd_rem:
pha
pha
jmp execute_statements_end_of_line
+2 -6
View File
@@ -3,10 +3,6 @@
// #LAYOUT# * * #IGNORE
cmd_restore:
// PLACEHOLDER for completeness - jumptable contains direct address
jsr do_restore
// RESTORE command does not stop execution (confirmed on a C64)
jmp end_of_statement
// RESTORE command does not stop execution (confirmed on a C64)
+9
View File
@@ -4,9 +4,15 @@
cmd_run:
// RUN clears all variables
jsr do_clr
cmd_goto:
// XXX optimize this: deduplicate last part (and init_oldtxt) with load/verify,
// if line number greater than current line - find line backwards
// Disable Kernal messages
lda #$00
jsr JSETMSG
@@ -24,4 +30,7 @@ cmd_goto:
jmp do_UNDEFD_STATEMENT_error
!:
// Run it!
pha
pha
jmp execute_line
+1 -1
View File
@@ -40,4 +40,4 @@ cmd_save_do: // entry point for BSAVE
// Execute next statement
jmp end_of_statement
rts
+1 -1
View File
@@ -27,4 +27,4 @@ cmd_stop:
cmd_end:
jmp shell_main_loop
jmp end_of_program
+1 -4
View File
@@ -60,10 +60,7 @@ cmd_sys_setup_call:
plp
// Call the routine.
jsr USRPOK
jmp end_of_statement
jmp USRPOK
//
// XXX Temporary ugly hack to support 'SYS PI*656'