2 ; Ullrich von Bassewitz, 02.06.1998
4 ; char* strlower (char* s);
5 ; char* strlwr (char* s);
10 .export _strlower, _strlwr
19 sta ptr1 ; Save s (working copy)
22 sta ptr2+2 ; save function result
25 loop: lda (ptr1),y ; get character
28 lda __ctype,x ; get character classification
29 and #CT_UPPER ; upper case char?
31 txa ; get character back into accu
33 sbc #<('A'-'a') ; make lower case char
34 sta (ptr1),y ; store back
37 inc ptr1+1 ; handle offset overflow
38 bne loop ; branch always
40 ; Done, return the argument string