annotate lib/alib/strncmp.a @ 2474:7d70b7e1cb21

Moved net and alib files into here
author boisy
date Tue, 30 Mar 2010 02:44:42 +0000
parents
children aaba193af04f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2474
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
1 *************************************
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
2
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
3 * STRNCMP: compare 2 null terminated strings
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
4 * maximum number of bytes to compare in D
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
5 *
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
6 * OTHER MODULES NEEDED: COMPARE
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
7
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
8 * ENTRY: X=start of 1st string
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
9 * Y=start of 2nd string
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
10 * D=number of bytes to compare
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
11 * CASEMTCH:(a global variable in COMPARE)
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
12 * 0=match for case
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
13 * -1=ignore case differences
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
14
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
15 * EXIT: CC zero set if equal (beq)
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
16 * carry + zero clear if 1>2 (bhi)
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
17 * carry set if 1<2 (blo)
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
18
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
19 nam Compare 2 Strings
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
20 ttl Assembler Library Module
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
21
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
22
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
23 psect STRNCMP,0,0,0,0,0
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
24
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
25
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
26 STRNCMP:
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
27 pshs d,x,y,u
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
28
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
29 tfr y,u U=string2
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
30 tfr d,y use Y for counter
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
31 leay 1,y comp for initial dec.
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
32
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
33 loop
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
34 leay -1,y count down
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
35 beq exit no miss-matches
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
36 lda ,x+ get 2 to compare
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
37 ldb ,u+
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
38 lbsr COMPARE go compare chars.
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
39 beq loop chars match, do more
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
40
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
41 * exit with flags set. Do a beq, bhi or blo to correct
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
42 * routines....
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
43
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
44 exit
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
45 puls d,x,y,u,pc
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
46
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
47 endsect