/[projet1]/public/pc/tools/osdk/main/Osdk/_final_/lib2/strupr.s
Defence Force logotype

Contents of /public/pc/tools/osdk/main/Osdk/_final_/lib2/strupr.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1154 - (show annotations)
Sun Aug 10 18:19:54 2014 UTC (5 years, 6 months ago) by dbug
File size: 867 byte(s)


1 ;char *strupr(char *s)
2
3 _strupr
4 ldy #1
5 lda (sp),y
6 sta strupr1+2
7 sta strupr1a+2
8 sta strupr2+3
9 dey
10 lda (sp),y
11 sta strupr1+1
12 sta strupr1a+1
13 sta strupr2+1
14
15 strupr1
16 lda $2211,y
17 beq strupr2 ; end of string
18
19 tax ; code adapted from _tolower
20 lda ctype,x
21 and #$02 ;_L
22 beq strupr1b ;skip if not upper-case
23 sec
24 txa ;original char
25 sbc #$20 ;force upper case
26
27 strupr1a
28 sta $2211,y ;store back into string
29
30 strupr1b
31 iny
32 bne strupr1 ; next character
33 inc strupr1+2 ; next page
34 inc strupr1a+2 ; next page
35 jmp strupr1
36
37 strupr2
38 ldx #1 ; self modifying
39 lda #3 ; ditto
40 rts
41

  ViewVC Help
Powered by ViewVC 1.1.26