use pseudocode instead of jmp/bra selection

This commit is contained in:
FeralChild64 committed 2020-07-19 10:23:26 +02:00
1 parent 92359c64f2
commit 3b4cf3faef
17 files changed
+32 -125

No files matched your search

+1 -6
View File
@@ -49,12 +49,7 @@ cmd_goto:
// Else - search from the current line
jsr find_line_from_current
#if HAS_OPCODES_65C02
bra cmd_goto_check
#else
jmp cmd_goto_check
#endif
jmp_8 cmd_goto_check
cmd_goto_direct:
+1 -5
View File
@@ -123,11 +123,7 @@ cmd_mem_loop:
bcs !+
lda #$3F
jsr JCHROUT
#if HAS_OPCODES_65C02
bra cmd_mem_next
#else
jmp cmd_mem_next
#endif
jmp_8 cmd_mem_next
!:
jsr print_integer
+5 -5
View File
@@ -24,6 +24,8 @@ find_line_from_current:
// Fetch the high byte of line number and compare
ldy #$03
// XXX consider optimized 46K/50K version
#if CONFIG_MEMORY_MODEL_60K
ldx #<OLDTXT+0
jsr peek_under_roms
@@ -67,6 +69,8 @@ find_line_next:
jsr peek_line_pointer_null_check
bcc find_line_fail // branch in no more lines exist
// XXX consider optimized 46K/50K version
ldy #$00
#if CONFIG_MEMORY_MODEL_60K
@@ -93,11 +97,7 @@ find_line_next:
pla
sta OLDTXT+0
#if HAS_OPCODES_65C02
bra find_line_from_current
#else
jmp find_line_from_current
#endif
jmp_8 find_line_from_current
find_line_fail:
+1 -5
View File
@@ -91,11 +91,7 @@ tk_shorten_3n_byte_nibble: // tk__nibble_flag = $00, both nibbles fr
// Reuse 'tk_shorten_1n_hi'
sty tk__byte_offset
#if HAS_OPCODES_65C02
bra tk_shorten_1n_hi
#else
jmp tk_shorten_1n_hi
#endif
jmp_8 tk_shorten_1n_hi
tk_shorten_3n_2bytes: // tk__nibble_flag = $FF, only the high nibble is free
+1 -5
View File
@@ -100,11 +100,7 @@ tokenise_line_loop:
jsr tk_shorten
#if HAS_OPCODES_65C02
bra !-
#else
jmp !-
#endif
jmp_8 !-
tokenise_line_keyword_V2:
+1 -5
View File
@@ -114,11 +114,7 @@ FRMEVL_loop:
#endif
#if HAS_OPCODES_65C02
bra FRMEVL_got_value
#else
jmp FRMEVL_got_value
#endif
jmp_8 FRMEVL_got_value
!:
// There is one possibility left - a floating point value
+1 -5
View File
@@ -80,11 +80,7 @@ fetch_uint16_loop:
// Next iteration
#if HAS_OPCODES_65C02
bra fetch_uint16_loop
#else
jmp fetch_uint16_loop
#endif
jmp_8 fetch_uint16_loop
fetch_uint16_end:
+2 -10
View File
@@ -67,11 +67,7 @@ fetch_variable_type_float:
dew TXTPTR
#endif
#if HAS_OPCODES_65C02
bra fetch_variable_special
#else
jmp fetch_variable_special
#endif
jmp_8 fetch_variable_special
fetch_variable_type_integer:
@@ -313,8 +309,4 @@ fetch_variable_alocate_space_OK:
// Adjust variable pointer and quit
#if HAS_OPCODES_65C02
bra fetch_variable_adjust_VARPNT
#else
jmp fetch_variable_adjust_VARPNT
#endif
jmp_8 fetch_variable_adjust_VARPNT
+2 -5
View File
@@ -16,11 +16,8 @@ tmpstr_free_FAC1:
sta DSCPNT+1
lda __FAC1+2
#if HAS_OPCODES_65C02
bra !+
#else
jmp !+
#endif
jmp_8 !+
tmpstr_free_FAC2:
+1 -5
View File
@@ -138,8 +138,4 @@ varstr_alloc_fail:
dec GARBFL // $00 -> $FF
jsr varstr_garbage_collect
#if HAS_OPCODES_65C02
bra varstr_alloc_retry
#else
jmp varstr_alloc_retry
#endif
jmp_8 varstr_alloc_retry
@@ -44,12 +44,7 @@ peek_under_roms_via_OLDTXT:
// Retrieve value from under ROMs
lda (OLDTXT), y
#if HAS_OPCODES_65C02
bra peek_under_roms_finalize
#else
jmp peek_under_roms_finalize
#endif
jmp_8 peek_under_roms_finalize
peek_under_roms_via_VARPNT:
@@ -61,12 +56,7 @@ peek_under_roms_via_VARPNT:
// Retrieve value from under ROMs
lda (VARPNT), y
#if HAS_OPCODES_65C02
bra peek_under_roms_finalize
#else
jmp peek_under_roms_finalize
#endif
jmp_8 peek_under_roms_finalize
peek_under_roms_via_FAC1_PLUS_1:
@@ -78,12 +68,7 @@ peek_under_roms_via_FAC1_PLUS_1:
// Retrieve value from under ROMs
lda (__FAC1 + 1), y
#if HAS_OPCODES_65C02
bra peek_under_roms_finalize
#else
jmp peek_under_roms_finalize
#endif
jmp_8 peek_under_roms_finalize
#if ROM_LAYOUT_M65
+1 -5
View File
@@ -33,11 +33,7 @@ shift_mem_up_internal:
dec memmove__size+1
bne !-
#if HAS_OPCODES_65C02
bra shift_mem_internal_finalize
#else
jmp shift_mem_internal_finalize
#endif
jmp_8 shift_mem_internal_finalize
shift_mem_down_internal:
+5 -20
View File
@@ -127,11 +127,8 @@ list_display_token_CC:
// Now ask for it to be printed
jsr print_packed_keyword_CC
#if HAS_OPCODES_65C02
bra list_token_displayed
#else
jmp list_token_displayed
#endif
jmp_8 list_token_displayed
list_display_token_CD:
@@ -169,11 +166,7 @@ list_display_token_CD:
// Now ask for it to be printed
jsr print_packed_keyword_CD
#if HAS_OPCODES_65C02
bra list_token_displayed
#else
jmp list_token_displayed
#endif
jmp_8 list_token_displayed
list_display_token_V2:
@@ -242,11 +235,7 @@ list_is_unknown:
jsr STROUT
ply_trash_a
#if HAS_OPCODES_65C02
bra !+
#else
jmp !+
#endif
jmp_8 !+
list_is_literal_known:
@@ -263,10 +252,6 @@ list_display_unknown_token:
pla
pla
#if HAS_OPCODES_65C02
bra list_is_unknown
#else
jmp list_is_unknown
#endif
jmp_8 list_is_unknown
#endif // ROM layout
+1 -1
View File
@@ -114,7 +114,7 @@ print_freq_packed_string_nibble_hi:
tax
lda packed_as_1n-1, x
jmp !+ // XXX should be bra on some CPUs
jmp_8 !+
print_freq_packed_string_3n_single:
+2 -10
View File
@@ -216,11 +216,7 @@ wedge_dos_status_get_done:
wedge_dos_status:
jsr wedge_dos_status_get
#if HAS_OPCODES_65C02
bra wedge_dos_status_print_no_new_line
#else
jmp wedge_dos_status_print_no_new_line
#endif
jmp_8 wedge_dos_status_print_no_new_line
wedge_dos_status_print:
@@ -243,11 +239,7 @@ wedge_dos_status_print_no_new_line:
!:
// Clean-up and exit
#if HAS_OPCODES_65C02
bra wedge_dos_clean_exit
#else
jmp wedge_dos_clean_exit
#endif
jmp_8 wedge_dos_clean_exit
wedge_dos_directory: