]> git.sur5r.net Git - cc65/blob - libsrc/common/toupper.s
Added mouse module from C64
[cc65] / libsrc / common / toupper.s
1 ;
2 ; Ullrich von Bassewitz, 02.06.1998
3 ;
4 ; int toupper (int c);
5 ;
6
7         .export         _toupper
8         .import         __ctype, __cdiff
9
10 _toupper:
11         tay                     ; Get c into Y
12         lda     __ctype,y       ; Get character classification
13         lsr     a               ; Get bit 0 (lower char) into carry
14         tya                     ; Get C back into A
15         bcc     L9              ; Jump if not lower char
16         clc
17         adc     __cdiff         ; make upper case char
18 L9:     rts                     ; CC are set
19