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