Mercurial > hg > Members > kono > nitros9-code
comparison lib/alib/parsnstr.as @ 2783:03f26e88b809 lwtools-port
Renamed files and setup for lwasm/lwlink work
author | Boisy Pitre <boisy.pitre@nuance.com> |
---|---|
date | Sat, 26 Jan 2013 17:18:24 -0600 |
parents | lib/alib/parsnstr.a@aaba193af04f |
children |
comparison
equal
deleted
inserted
replaced
2782:aaba193af04f | 2783:03f26e88b809 |
---|---|
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 section .text | |
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 |