From c3cbfcebfb96306deade2ad208bd6bf0f1a143be Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 2 Oct 2019 22:35:36 +0200 Subject: [PATCH] all label naming conflicts resolved --- c64/aliases/,aliases_ram_lowmem.s | 2 +- c64/basic/,aliases.s | 17 ------ c64/basic/basic_cold_start.s | 8 +-- c64/basic/basic_delete_line.s | 22 ++++---- c64/basic/basic_execute_line.s | 36 ++++++------- c64/basic/basic_find_line.s | 24 ++++----- c64/basic/basic_find_next_line.s | 12 ++--- c64/basic/basic_follow_link_to_next_line.s | 10 ++-- c64/basic/basic_insert_line.s | 30 +++++------ c64/basic/basic_main_loop.s | 6 +-- c64/basic/basic_shift_mem_down.s | 34 ++++++------ c64/basic/basic_shift_mem_up.s | 52 +++++++++--------- c64/basic/cmd_break.s | 11 ++-- c64/basic/cmd_list.s | 22 ++++---- c64/basic/cmd_load.s | 54 +++++++++---------- c64/basic/cmd_new.s | 40 +++++++------- c64/basic/cmd_run.s | 12 ++--- c64/basic/do_basic_error.s | 14 ++--- c64/basic/injest_number.s | 5 +- c64/basic/peek_line_pointer_null_check.s | 6 +-- c64/basic/under_rom_routines.s | 8 +-- c64/basic/wedge_dos.s | 6 +-- .../,target_ultimate64/,aliases_ultimate64.s | 6 +-- c64/kernal/chrout_real.s | 17 +++--- c64/kernal/jumptable/fff3.jiobase.s | 2 +- c64/kernal/udtim.s | 9 ++-- c64/kernal/under_rom_routines.s | 8 +-- 27 files changed, 222 insertions(+), 251 deletions(-) diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 70df9d2c..8a90a931 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -73,7 +73,7 @@ .label ARISGN = $6F // -- NOT IMPLEMENTED -- .label FACOV = $70 // FAC1 low order mantissa - .label FBUFPT = $67 // $71-$72 -- NOT IMPLEMENTED -- + .label FBUFPT = $71 // $71-$72 -- NOT IMPLEMENTED -- .label CHRGET = $73 // $73-$8A -- NOT IMPLEMENTED -- .label TXTPTR = $7A // $7A-$7B current BASIC statement pointer .label RNDX = $8B // $8B-$8F -- NOT IMPLEMENTED -- diff --git a/c64/basic/,aliases.s b/c64/basic/,aliases.s index d926afe1..2726f748 100644 --- a/c64/basic/,aliases.s +++ b/c64/basic/,aliases.s @@ -16,20 +16,3 @@ .label __memmove_src = $69 .label __memmove_dst = $6B .label __memmove_size = $6D - -// XXX cleanup lines below - - // The various pointers that separate memory regions for BASIC storage - // We have multiple names for the ones that mark the boundary of regions. - .label basic_start_of_text_ptr = $2b - .label basic_end_of_text_ptr = $2d - .label basic_start_of_vars_ptr = $2d - .label basic_end_of_vars_ptr = $2f - .label basic_start_of_arrays_ptr = $2f - .label basic_end_of_arrays_ptr = $31 - .label basic_start_of_free_space_ptr = $31 - .label basic_start_of_strings_ptr = $33 - .label basic_top_of_memory_ptr = $37 - .label basic_current_line_number = $39 - .label basic_previous_line_number = $3b - .label basic_current_line_ptr = $3d diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index ed3dbe46..c77ad42a 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -41,12 +41,12 @@ basic_cold_start: // Work out free bytes, display them jsr basic_do_new - lda basic_top_of_memory_ptr+0 + lda MEMSIZ+0 sec - sbc basic_start_of_text_ptr+0 + sbc TXTTAB+0 tax - lda basic_top_of_memory_ptr+1 - sbc basic_start_of_text_ptr+1 + lda MEMSIZ+1 + sbc TXTTAB+1 jsr print_integer diff --git a/c64/basic/basic_delete_line.s b/c64/basic/basic_delete_line.s index 00c2051a..33a3d5b5 100644 --- a/c64/basic/basic_delete_line.s +++ b/c64/basic/basic_delete_line.s @@ -9,18 +9,18 @@ basic_delete_line: // jsr printf // .text "DELETING LINE AT $" - // .byte $f1,basic_current_line_ptr - // .byte $f0,basic_current_line_ptr + // .byte $f1,OLDTXT + // .byte $f0,OLDTXT // .byte $0d,0 // Get address of next line ldy #0 #if CONFIG_MEMORY_MODEL_60K - ldx #basic_current_line_ptr - // .byte $f0,basic_current_line_ptr + // .byte $f1,OLDTXT + // .byte $f0,OLDTXT // .text ", STATEMENT PTR = $" // .byte $f1,TXTPTR // .byte $f0,TXTPTR @@ -119,7 +119,7 @@ not_a_token: // BASIC programmers should implement communication with drives // the standard way, handling channels properly. Besides, // current implementation does not support characters under ROM - ldx basic_current_line_number+1 + ldx CURLIN+1 cpx #$ff bne !+ // We are in direct mode, allow wedge to handle '@' sign @@ -175,7 +175,7 @@ basic_end_of_line: // one. // Are we in direct mode - lda basic_current_line_number+1 + lda CURLIN+1 cmp #$ff bne basic_not_direct_mode @@ -184,17 +184,17 @@ basic_end_of_line: basic_not_direct_mode: // Copy line number to previous line number - lda basic_current_line_number+0 - sta basic_previous_line_number+0 - lda basic_current_line_number+1 - sta basic_previous_line_number+1 + lda CURLIN+0 + sta OLDLIN+0 + lda CURLIN+1 + sta OLDLIN+1 // Advance the basic line pointer to the next line jsr basic_follow_link_to_next_line // Are we at the end of the program? - lda basic_current_line_ptr+0 - ora basic_current_line_ptr+1 + lda OLDTXT+0 + ora OLDTXT+1 bne basic_execute_from_current_line // End of program found @@ -210,33 +210,33 @@ basic_execute_from_current_line: jmp basic_main_loop !: // Skip pointer and line number to get address of first statement - lda basic_current_line_ptr+0 + lda OLDTXT+0 clc adc #4 sta TXTPTR+0 - lda basic_current_line_ptr+1 + lda OLDTXT+1 adc #0 sta TXTPTR+1 ldy #2 #if CONFIG_MEMORY_MODEL_60K - ldx #basic_current_line_ptr - // .byte $f0,basic_current_line_ptr + // .byte $f1,OLDTXT + // .byte $f0,OLDTXT // .byte $0d,0 - lda basic_current_line_ptr+0 + lda OLDTXT+0 pha - lda basic_current_line_ptr+1 + lda OLDTXT+1 pha @@ -44,27 +44,27 @@ basic_insert_line: // Now increase top of BASIC mem pla clc - adc basic_end_of_text_ptr+0 - sta basic_end_of_text_ptr+0 - lda basic_end_of_text_ptr+1 + adc VARTAB+0 + sta VARTAB+0 + lda VARTAB+1 adc #0 - sta basic_end_of_text_ptr+1 + sta VARTAB+1 // Get pointer back pla - sta basic_current_line_ptr+1 + sta OLDTXT+1 pla - sta basic_current_line_ptr+0 + sta OLDTXT+0 // Write the line number ldy #2 lda LINNUM+0 #if CONFIG_MEMORY_MODEL_60K - ldx #basic_end_of_text_ptr - // .byte $f0,basic_end_of_text_ptr + // .byte $f1,VARTAB + // .byte $f0,VARTAB // .byte $0d // .text "SHIFTING DOWN $" // .byte $f1,<__memmove_size,>__memmove_size @@ -116,10 +116,10 @@ relink_down_next_line: ldy #0 #if CONFIG_MEMORY_MODEL_60K - ldx #basic_end_of_text_ptr - // .byte $f0,basic_end_of_text_ptr + // .byte $f1,VARTAB + // .byte $f0,VARTAB // .byte $0d // .text "SHIFTING UP $" // .byte $f1,<__memmove_size,>__memmove_size @@ -106,22 +106,22 @@ basic_shift_mem_up_and_relink: // to make it end up pointing to the next line ldy #0 - lda basic_current_line_ptr+0 + lda OLDTXT+0 #if CONFIG_MEMORY_MODEL_60K - ldx #basic_end_of_text_ptr - // .byte $f0,basic_end_of_text_ptr + // .byte $f1,VARTAB + // .byte $f0,VARTAB // .text $d," BEFORE = $" // .byte $f1,<__memmove_dst,>__memmove_dst // .byte $f0,<__memmove_dst,>__memmove_dst @@ -175,10 +175,10 @@ relink_up_next_line: lda __memmove_src+0 #if CONFIG_MEMORY_MODEL_60K - ldx #$0801 - sta basic_start_of_text_ptr+1 - sta basic_start_of_vars_ptr+1 + sta TXTTAB+1 + sta VARTAB+1 lda #<$0803 - sta basic_start_of_vars_ptr+0 + sta VARTAB+0 // Zero line pointer - // XXX - We should also zero $0800, i.e., basic_start_of_text_ptr - 1 + // XXX - We should also zero $0800, i.e., TXTTAB - 1 ldy #$00 tya - sta (basic_start_of_text_ptr),y + sta (TXTTAB),y iny - sta (basic_start_of_text_ptr),y + sta (TXTTAB),y // Get top of memory. @@ -39,7 +39,7 @@ basic_do_new: // free for some optimisation structures, e.g., FOR/NEXT loop // records (without them going on the stack), GOSUB stack // (same story), expression value cache? - + sec // Read, not write value jsr JMEMTOP cpx #$80 @@ -56,25 +56,25 @@ basic_do_new: #else // CONFIG_MEMORY_MODEL_38K lda #>$A000 #endif - sta basic_top_of_memory_ptr+1 - sta basic_start_of_strings_ptr+1 + sta MEMSIZ+1 + sta FRETOP+1 #if CONFIG_MEMORY_MODEL_60K lda #<$F7FF #else // CONFIG_MEMORY_MODEL_38K lda #<$A000 #endif - sta basic_top_of_memory_ptr+0 - sta basic_start_of_strings_ptr+0 - + sta MEMSIZ+0 + sta FRETOP+0 + // FALL THROUGH - + basic_do_clr: // Clear variables, arrays and strings - lda basic_start_of_vars_ptr+0 - sta basic_start_of_arrays_ptr+0 - sta basic_start_of_free_space_ptr+0 - lda basic_start_of_vars_ptr+1 - sta basic_start_of_arrays_ptr+1 - sta basic_start_of_free_space_ptr+1 + lda VARTAB+0 + sta ARYTAB+0 + sta STREND+0 + lda VARTAB+1 + sta ARYTAB+1 + sta STREND+1 rts diff --git a/c64/basic/cmd_run.s b/c64/basic/cmd_run.s index 83b3c12c..fefd6e6d 100644 --- a/c64/basic/cmd_run.s +++ b/c64/basic/cmd_run.s @@ -1,13 +1,13 @@ cmd_run: // RUN clears all variables jsr basic_do_clr -cmd_goto: +cmd_goto: // Reset line pointer to first line of program. - lda basic_start_of_text_ptr+0 - sta basic_current_line_ptr+0 - lda basic_start_of_text_ptr+1 - sta basic_current_line_ptr+1 - + lda TXTTAB+0 + sta OLDTXT+0 + lda TXTTAB+1 + sta OLDTXT+1 + jsr basic_end_of_statement_check bcs !+ diff --git a/c64/basic/do_basic_error.s b/c64/basic/do_basic_error.s index e41822bf..296241c1 100644 --- a/c64/basic/do_basic_error.s +++ b/c64/basic/do_basic_error.s @@ -120,12 +120,12 @@ do_TO_MANY_FILES_error: lda $EA and #$80 sta $EA - + // FALL THROUGH // Error # in X - -do_basic_error: + +do_basic_error: // "?" txa pha @@ -142,12 +142,12 @@ do_basic_error: // A space between error name and word error lda #$20 jsr $ffd2 - + // "ERROR" ldx #33 jsr print_packed_message - lda basic_current_line_number+1 + lda CURLIN+1 cmp #$ff beq !+ @@ -156,8 +156,8 @@ do_basic_error: .text " IN " .byte 0 - lda basic_current_line_number+1 - ldx basic_current_line_number+0 + lda CURLIN+1 + ldx CURLIN+0 jsr print_integer !: // New lines diff --git a/c64/basic/injest_number.s b/c64/basic/injest_number.s index 83f7d464..6266e036 100644 --- a/c64/basic/injest_number.s +++ b/c64/basic/injest_number.s @@ -56,7 +56,7 @@ injest_number: ldy #$00 lda (TXTPTR),y cmp #$AB - bne ij_not_minus + bne ij_loop1 // not minus // Set sign to negative lda #$ff @@ -64,9 +64,6 @@ injest_number: // Skip over the minus sign jsr basic_consume_character - -ij_not_minus: - ij_loop1: ldy #$00 diff --git a/c64/basic/peek_line_pointer_null_check.s b/c64/basic/peek_line_pointer_null_check.s index e7a8fb38..e71a8d56 100644 --- a/c64/basic/peek_line_pointer_null_check.s +++ b/c64/basic/peek_line_pointer_null_check.s @@ -6,11 +6,11 @@ peek_line_pointer_null_check: ldy #$00 #if CONFIG_MEMORY_MODEL_60K - ldx #BUF - stx basic_current_line_ptr+1 - ldx #basic_current_line_ptr + stx OLDTXT+1 + ldx #OLDTXT jsr list_single_line // Read & display next line or quit diff --git a/c64/kernal/,target_ultimate64/,aliases_ultimate64.s b/c64/kernal/,target_ultimate64/,aliases_ultimate64.s index 65e2d20a..5c8bd0dc 100644 --- a/c64/kernal/,target_ultimate64/,aliases_ultimate64.s +++ b/c64/kernal/,target_ultimate64/,aliases_ultimate64.s @@ -4,10 +4,8 @@ // and ultimate_dos_v1.0.pdf and command_interface_v1.0.pdf by Gideon Zweijtzer // Command interface registers - .label U64_CONTROL = $DF1C // write - .label U64_STATUS = $DF1C // read - .label U64_COMMAND_DATA = $DF1D // write - .label U64_IDENTIFICATION = $DF1D // read + .label U64_CONTROL_STATUS = $DF1C // write = CONTROL, read = STATUS + .label U64_COMMAND_DATA_IDENTIFY = $DF1D // write = COMMAND_DATA, read = IDENTIFICATION .label U64_RESPONSE_DATA = $DF1E // read only .label U64_STATUS_DATA = $DF1F // read only diff --git a/c64/kernal/chrout_real.s b/c64/kernal/chrout_real.s index 1c60be55..578383c0 100644 --- a/c64/kernal/chrout_real.s +++ b/c64/kernal/chrout_real.s @@ -365,12 +365,12 @@ not_clearscreen: bcc !+ and #$7f - jmp not_high_char + jmp output_literal_char // not high char !: // Range $20-$3F is unchanged cmp #$40 - bcc not_high_char + bcc output_literal_char // not high char // Unshifted letters and symbols from $40-$5F // all end up being -$40 @@ -385,16 +385,12 @@ not_clearscreen: // Fix shifted chars by adding $20 again cmp #$20 - bcc not_high_char + bcc output_literal_char // not high char cmp #$40 - bcs not_high_char + bcs output_literal_char // not high char clc adc #$20 -not_high_char: - -chrout_l1: - output_literal_char: // Write normal character on the screen @@ -449,7 +445,7 @@ screen_grow_logical_line: // Don't grow line if it is already grown lda LDTBL,y bpl !+ - jmp done_grow_line + jmp not_last_line // doneb grow line !: lda #$80 sta LDTBL,y @@ -563,10 +559,9 @@ no_copy_down: dey cpy #40 bne !- - + rts -done_grow_line: not_last_line: rts diff --git a/c64/kernal/jumptable/fff3.jiobase.s b/c64/kernal/jumptable/fff3.jiobase.s index 3fbd234c..3250765f 100644 --- a/c64/kernal/jumptable/fff3.jiobase.s +++ b/c64/kernal/jumptable/fff3.jiobase.s @@ -12,7 +12,7 @@ // As there is nothing between here and $FFFA, we can just hard code this in place. -iobase: +// iobase: - commented out to prevent label naming conflict ldy #$DC ldx #$00 rts diff --git a/c64/kernal/udtim.s b/c64/kernal/udtim.s index 9fce89a2..2d8aac00 100644 --- a/c64/kernal/udtim.s +++ b/c64/kernal/udtim.s @@ -14,14 +14,13 @@ UDTIM: // after this time we have to reset the clock. inc TIME+0 - bne udtim_clock_done + bne udtim_update_stkey // done with clock inc TIME+1 bne udtim_clock_rollover inc TIME+2 // FALLTROUGH -udtim_clock_done: udtim_update_stkey: // entry to be used when interrupts are disabled // Another action we have to perform is to copy the last row of keyboard to RAM, @@ -44,11 +43,11 @@ udtim_clock_rollover: // At this point TIME+0 contains 0 lda TIME+1 cmp #$1A - bne udtim_clock_done + bne udtim_update_stkey // done with clock lda TIME+2 cmp #$4F - bne udtim_clock_done + bne udtim_update_stkey // done with clock lda #$00 sta TIME+2 sta TIME+1 - beq udtim_clock_done // will always jump + beq udtim_update_stkey // done with clock - will always jump diff --git a/c64/kernal/under_rom_routines.s b/c64/kernal/under_rom_routines.s index 8b4526df..5e45aa15 100644 --- a/c64/kernal/under_rom_routines.s +++ b/c64/kernal/under_rom_routines.s @@ -8,9 +8,9 @@ install_ram_routines: // Copy routines into place - ldx #ram_routines_end-ram_routines_start-1 + ldx #__ram_routines_end-__ram_routines_start-1 !: - lda ram_routines_start,x + lda __ram_routines_start,x sta tiny_nmi_handler,x dex bpl !- @@ -23,7 +23,7 @@ install_ram_routines: rts -ram_routines_start: +__ram_routines_start: tiny_nmi_handler_routine: inc missed_nmi_flag @@ -63,6 +63,6 @@ memmap_allram_routine: pla rts -ram_routines_end: +__ram_routines_end: #endif // CONFIG_MEMORY_MODEL_60K