]> git.sur5r.net Git - cc65/blob - libsrc/common/strlen.s
Adjusted C declarations to the changed static driver names.
[cc65] / libsrc / common / strlen.s
1 ;
2 ; Ullrich von Bassewitz, 31.05.1998
3 ;
4 ; int strlen (const char* s);
5 ;
6
7         .export         _strlen
8         .importzp       ptr1
9
10 _strlen:
11         sta     ptr1            ; Save s
12         stx     ptr1+1
13         ldx     #0              ; YX used as counter
14         ldy     #0
15
16 L1:     lda     (ptr1),y
17         beq     L9
18         iny
19         bne     L1
20         inc     ptr1+1
21         inx
22         bne     L1
23
24 L9:     tya                     ; get low byte of counter, hi's all set
25         rts
26