Mercurial > hg > Members > kono > nitros9-code
comparison lib/alib/parsnstr.a @ 2474:7d70b7e1cb21
Moved net and alib files into here
author | boisy |
---|---|
date | Tue, 30 Mar 2010 02:44:42 +0000 |
parents | |
children | aaba193af04f |
comparison
equal
deleted
inserted
replaced
2473:dac1ff96637f | 2474:7d70b7e1cb21 |
---|---|
1 * Parse sign bit terminated string to convert it to a | |
2 * null terminated string. Note: if X and Y are the same | |
3 * the existing string will be overwritten -- don't do this | |
4 * with psects... | |
5 | |
6 * OTHER MODULES NEEDED: none | |
7 | |
8 * ENTRY: X=start of sign bit terminated string | |
9 * Y=buffer for null terminated string | |
10 | |
11 * EXIT: D=string size (not including null) | |
12 * All other regs (except cc) preserved | |
13 | |
14 | |
15 nam Parse sign-bit terminated string | |
16 ttl Assembler Library Module | |
17 | |
18 | |
19 psect PARSNSTR,0,0,0,0,0 | |
20 | |
21 | |
22 PARSNSTR: | |
23 pshs x | |
24 lbsr STRHCPY copy string | |
25 tfr y,x point to moved string | |
26 lbsr STRHLEN find length of string | |
27 pshs d size | |
28 leax d,x | |
29 lda ,-x get final byte | |
30 anda #%01111111 clear sign bit | |
31 clrb add null terminator | |
32 std ,x | |
33 puls d,x,pc | |
34 | |
35 | |
36 endsect | |
37 |