more size optimizations in BASIC interpreter
This commit is contained in:
1 parent
4871abd79b
commit
dbd8c77751
22 files changed
+67
-61
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -9,4 +9,4 @@ cmd_new:
|
||||
|
||||
// NEW command terminates execution (confirmed on a C64)
|
||||
|
||||
jmp shell_main_loop
|
||||
jmp end_of_program
|
||||
@@ -91,4 +91,4 @@ cmd_print_done:
|
||||
|
||||
// Execute next statement
|
||||
|
||||
jmp end_of_statement
|
||||
rts
|
||||
@@ -7,4 +7,6 @@
|
||||
|
||||
cmd_rem:
|
||||
|
||||
pha
|
||||
pha
|
||||
jmp execute_statements_end_of_line
|
||||
@@ -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)
|
||||
@@ -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
|
||||
@@ -40,4 +40,4 @@ cmd_save_do: // entry point for BSAVE
|
||||
|
||||
// Execute next statement
|
||||
|
||||
jmp end_of_statement
|
||||
rts
|
||||
@@ -27,4 +27,4 @@ cmd_stop:
|
||||
|
||||
cmd_end:
|
||||
|
||||
jmp shell_main_loop
|
||||
jmp end_of_program
|
||||
@@ -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'
|
||||
|
||||
Reference in new issue
Block a user