2 ; Ullrich von Bassewitz, 02.06.1998
4 ; char* strupper (char* s);
5 ; char* strupr (char* s);
10 .export _strupper, _strupr
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_LOWER ; lower case char?
31 txa ; get character back into accu
33 adc #<('A'-'a') ; make upper 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