Further optimizations in common/conio.
This commit is contained in:
@@ -2,26 +2,26 @@
|
||||
; Ullrich von Bassewitz, 31.05.1998
|
||||
;
|
||||
; Note: strspn & strcspn call internally this function and rely on
|
||||
; the usage of only ptr1 here! Keep in mind when appling changes
|
||||
; the usage of only ptr2 here! Keep in mind when appling changes
|
||||
; and check the other implementations too!
|
||||
;
|
||||
; int strlen (const char* s);
|
||||
;
|
||||
|
||||
.export _strlen
|
||||
.importzp ptr1
|
||||
.importzp ptr2
|
||||
|
||||
_strlen:
|
||||
sta ptr1 ; Save s
|
||||
stx ptr1+1
|
||||
sta ptr2 ; Save s
|
||||
stx ptr2+1
|
||||
ldx #0 ; YX used as counter
|
||||
ldy #0
|
||||
|
||||
L1: lda (ptr1),y
|
||||
L1: lda (ptr2),y
|
||||
beq L9
|
||||
iny
|
||||
bne L1
|
||||
inc ptr1+1
|
||||
inc ptr2+1
|
||||
inx
|
||||
bne L1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user