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

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

Parent Directory Parent Directory | Revision Log Revision Log


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


1 ; int strcspn(char *s1, char *s2)
2
3 _strcspn
4 ldy #3 ; s2
5 lda (sp),y
6 sta tmp1+1
7 dey
8 lda (sp),y
9 sta tmp1
10 dey ; s1
11 lda (sp),y
12 sta strcspn1+2
13 dey
14 lda (sp),y
15 sta strcspn1+1
16
17 ldx #0
18 stx tmp2
19
20 strcspn1
21 lda $2211,x
22 beq strcspn3
23 sta tmp
24
25 ldy #0 ; inner loop, init
26 lda tmp1
27 sta strcspn2+1
28 lda tmp1+1
29 sta strcspn2+2
30
31 strcspn2 ; inner loop, loop
32 lda $2211,y
33 beq strcspn1a
34 cmp tmp
35
36 beq strcspn3
37 iny
38 bne strcspn2
39 inc strcspn2+2
40 jmp strcspn2
41
42 strcspn1a
43 inx ; back to the outer loop
44 bne strcspn1
45 inc strcspn1+2
46 inc tmp2
47 jmp strcspn2
48
49 strcspn3
50 lda tmp2
51 rts

  ViewVC Help
Powered by ViewVC 1.1.26