2 ; 1998-06-02, Ullrich von Bassewitz
3 ; 2013-08-28, Greg King
5 ; char* __fastcall__ strlower (char* s);
6 ; char* __fastcall__ strlwr (char* s);
11 .export _strlower, _strlwr
20 sta ptr1 ; Save s (working copy)
23 stx ptr2+1 ; save function result
26 loop: lda (ptr1),y ; get character
29 lda __ctype,x ; get character classification
30 and #CT_UPPER ; upper case char?
32 txa ; get character back into accu
34 sbc #<('A'-'a') ; make lower case char
35 sta (ptr1),y ; store back
38 inc ptr1+1 ; handle offset overflow
39 bne loop ; branch always
41 ; Done, return the argument string