annotate lib/alib/strcmp.a @ 2700:772a16760499 lwtools-port

Slight improvements
author Boisy Pitre <boisy.pitre@nuance.com>
date Fri, 20 Jul 2012 13:36:02 -0500
parents 7d70b7e1cb21
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 * STRCMP: compare two null terminated strings.
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
4
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
5 * NOTE: This routine first finds the length of both
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
6 * strings and passes the length of the longer
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
7 * one to strncmp.
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
8
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
9 * OTHER MODULES NEEDED: STRNCMP, STRLEN
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
10
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
11
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
12 * ENTRY: X=start of 1st string
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
13 * Y=start of 2nd string
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
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
20 nam Compare Strings
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
21 ttl Assembler Library Module
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
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
24 psect STRCMP,0,0,0,0,0
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 STRCMP:
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
27 pshs d
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
28 lbsr STRLEN find len of str1
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
29 pshs d
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
30 exg y,x find len of str2
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
31 lbsr STRLEN
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
32 exg y,x restore ptrs
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
33 cmpd ,s
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
34 bhi ok
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
35 ldd ,s get bigger value
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
36
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
37 ok
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
38 leas 2,s clean stack
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
39 lbsr STRNCMP go compare
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
40 puls d,pc go home
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
41
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
42 endsect
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
43