Mercurial > hg > Members > kono > nitros9-code
annotate lib/alib/parsnstr.as @ 3278:ea1afb494127
defs: Add Bt.Sec for atari and corsham
author | Tormod Volden <debian.tormod@gmail.com> |
---|---|
date | Sat, 07 Mar 2020 23:52:40 +0100 |
parents | 03f26e88b809 |
children |
rev | line source |
---|---|
2474 | 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 | |
2782
aaba193af04f
Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2474
diff
changeset
|
19 section .text |
2474 | 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 |