2 ; Ullrich von Bassewitz, 03.06.1998
4 ; int stricmp (const char* s1, const char* s2); /* DOS way */
5 ; int strcasecmp (const char* s1, const char* s2); /* UNIX way */
8 .export _stricmp, _strcasecmp
11 .importzp ptr1, ptr2, tmp1
24 loop: lda (ptr2),y ; get char from second string
26 lda __ctype,x ; get character classification
27 and #CT_LOWER ; lower case char?
29 txa ; get character back
31 adc #<('A'-'a') ; make upper case char
33 L1: stx tmp1 ; remember upper case equivalent
35 lda (ptr1),y ; get character from first string
37 lda __ctype,x ; get character classification
38 and #CT_LOWER ; lower case char?
40 txa ; get character back
42 adc #<('A'-'a') ; make upper case char
45 L2: cpx tmp1 ; compare characters
48 beq L5 ; a/x both zero