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

Contents of /public/pc/tools/osdk/main/Osdk/_final_/lib2/strchr.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: 694 byte(s)


1 ; char *strchr(char *s, char c)
2
3 _strchr
4 ldy #0
5 lda (sp),y
6 sta strchr1+1 ; low(s)
7 iny
8 lda (sp),y
9 sta strchr1+2 ; high(s)
10 iny
11 lda (sp),y
12 sta strchr1+6 ; low(c)
13 ldx #0
14
15 strchr1
16 lda $2211,X
17 beq strchr2
18 cmp #$06
19 beq strchr3
20 inx
21 bne strchr1
22 inc strchr1+2
23 jmp strchr1
24
25 strchr2
26 jmp retzero ; character not found, return NULL
27
28 strchr3
29 clc ; character found, return pointer to it within s
30 txa
31 adc strchr1+1
32 tax
33 lda strchr1+2
34 adc #0
35 rts
36

  ViewVC Help
Powered by ViewVC 1.1.26