From 6be0731247cff96c9a7b4f12bb763bed9e5a4a8f Mon Sep 17 00:00:00 2001 From: Daniel Gimpelevich Date: Mon, 29 Sep 2025 17:12:34 -0700 Subject: [PATCH] Fix uncatalogued name clash with libsrc/runtime/leave.s Even though these labels are not exported, they can show up in linker maps and thus break o65 modules. --- libsrc/common/memset.s | 8 ++++---- libsrc/common/strcspn.s | 14 +++++++------- libsrc/common/strspn.s | 18 +++++++++--------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/libsrc/common/memset.s b/libsrc/common/memset.s index 5d56507a5..a62ce4c6c 100644 --- a/libsrc/common/memset.s +++ b/libsrc/common/memset.s @@ -81,13 +81,13 @@ L1: .repeat 2 ; Unroll this a bit to make it faster ; Set the remaining bytes if any L2: ldy ptr3 ; Get the low byte of n - beq leave ; something to set? No -> leave + beq @leave ; something to set? No -> leave -L3: dey +@L3: dey sta (ptr1),y ; set bytes in low sta (ptr2),y ; and high section - bne L3 ; flags still up to date from dey! -leave: + bne @L3 ; flags still up to date from dey! +@leave: jmp popax ; Pop ptr and return as result diff --git a/libsrc/common/strcspn.s b/libsrc/common/strcspn.s index 418bf6ac2..66f98fb62 100644 --- a/libsrc/common/strcspn.s +++ b/libsrc/common/strcspn.s @@ -27,21 +27,21 @@ _strcspn: loadChar: ldy #0 lda (ptr1),y ; get next char from s1 - beq leave ; handly byte of s1 -advance: + beq @leave ; handly byte of s1 +@advance: inc ptr1 ; advance string position to test - bne check + bne @check inc ptr1+1 dey ; correct next iny (faster/shorter than bne...) -checkNext: +@checkNext: iny -check: cpy tmp1 ; compare with length of test character string +@check: cpy tmp1 ; compare with length of test character string beq endOfTestChars cmp (ptr4),y ; found matching char? - bne checkNext + bne @checkNext -leave: txa ; restore position of finding +@leave: txa ; restore position of finding ldx tmp2 ; and return rts diff --git a/libsrc/common/strspn.s b/libsrc/common/strspn.s index 7e3f707d1..8c78fffce 100644 --- a/libsrc/common/strspn.s +++ b/libsrc/common/strspn.s @@ -27,26 +27,26 @@ _strspn: loadChar: ldy #0 lda (ptr1),y ; get next char from s1 - beq leave ; handly byte of s1 -advance: + beq @leave ; handly byte of s1 +@advance: inc ptr1 ; advance string position to test - bne check + bne @check inc ptr1+1 dey ; correct next iny (faster/shorter than bne...) -checkNext: +@checkNext: iny -check: cpy tmp1 ; compare with length of test character string - beq leave +@check: cpy tmp1 ; compare with length of test character string + beq @leave cmp (ptr4),y ; found matching char? - bne checkNext + bne @checkNext -foundTestChar: +@foundTestChar: inx bne loadChar inc tmp2 bne loadChar ; like bra... -leave: txa ; restore position of finding +@leave: txa ; restore position of finding ldx tmp2 ; and return rts