Mercurial > hg > Members > kono > nitros9-code
annotate lib/alib/prints.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 |
rev | line source |
---|---|
2474 | 1 *********************************** |
2 | |
3 * Print a program-embedded, null terminated string to standard out. | |
4 | |
5 * OTHER MODULES NEEDED: puts | |
6 | |
7 * ENTRY: Null terminated string must follow PRINTS call | |
8 * eg: LBSR PRINTS | |
9 * fcc /this is stuff to print/ | |
10 * fcb $0d * a new line | |
11 * fcc /more stuff to print/ | |
12 * fcb $0d,0 the end | |
13 * lda #xx or whatever.. | |
14 * * the rest of the program.... | |
15 | |
16 * EXIT: CC carry set if error | |
17 * B error code (if any) | |
18 | |
19 | |
20 nam Print Embedded String to Std. Out | |
21 ttl Assembler Library Module | |
22 | |
23 | |
2782
aaba193af04f
Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2474
diff
changeset
|
24 section .text |
2474 | 25 |
26 PRINTS: | |
27 pshs x,u | |
28 ldx 4,s get start of string (old return address) | |
29 tfr x,u copy it | |
30 | |
31 loop | |
32 tst ,u+ advance U to end of string | |
33 bne loop | |
34 | |
35 stu 4,s one past null=return address | |
36 lbsr PUTS print from orig pos. | |
37 puls x,u,pc return to caller | |
38 | |
39 endsect | |
40 |