2474
|
1 **********************************
|
|
2
|
|
3 * String Length: find length of sign-bit terminated string.
|
|
4 * note: sign-bit set byte IS included in count.
|
|
5
|
|
6 * OTHER MODULES NEEDED: none
|
|
7
|
|
8
|
|
9 * ENTRY: X=start of string
|
|
10
|
|
11
|
|
12 * EXIT: D=length
|
|
13 * all other regs (except cc) preserved
|
|
14
|
|
15
|
|
16 nam Find sign-bit term. String Length
|
|
17 ttl Assembler Library Module
|
|
18
|
|
19
|
|
20 psect STRHLEN,0,0,0,0,0
|
|
21
|
|
22 STRHLEN:
|
|
23 pshs x
|
|
24 clra it'll be at least one byte long
|
|
25 clrb
|
|
26
|
|
27 loop
|
|
28 addd #1 bump count
|
|
29 tst ,x+ end?
|
|
30 bpl loop
|
|
31
|
|
32 puls x,pc
|
|
33
|
|
34 endsect
|
|
35
|
|
36 |