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

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

Parent Directory Parent Directory | Revision Log Revision Log


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


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

  ViewVC Help
Powered by ViewVC 1.1.26