annotate lib/alib/strlen.as @ 2802:58ca94b06908 lwtools-port

now built from defs files
author Boisy Pitre <boisy.pitre@nuance.com>
date Fri, 01 Feb 2013 19:26:44 -0600
parents 03f26e88b809
children
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 * String Length: find length of null terminated string.
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
4 * note:null NOT included in count.
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 * ENTRY: X=start of string
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 * EXIT: D=length
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
9 * all other regs (except cc) preserved
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 nam Find String Length
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
12 ttl Assembler Library Module
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
13
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
14
2782
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2474
diff changeset
15 section .text
2474
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
16
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
17 STRLEN:
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
18 pshs x
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
19 ldd #-1 comp for inital inc
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
20
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
21 loop
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
22 addd #1 bump count
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
23 tst ,x+ end?
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
24 bne loop
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 puls x,pc
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
27
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
28 endsect
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
29
2782
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2474
diff changeset
30