Mercurial > hg > Members > kono > nitros9-code
annotate lib/alib/fputs.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 ************************************** |
2 | |
3 * FPUTS: print null terminated string to "A". | |
4 | |
5 * OTHER MODULES REQUIRED: none | |
6 | |
7 * ENTRY: X=start of string | |
8 * A=path | |
9 | |
10 * EXIT: CC carry set if error | |
11 * B = OS9 error if any (from I$WritLn) | |
12 | |
13 * NOTE: string is feed through I$WritLn for editing (adding LF, etc.) | |
14 | |
15 nam Output 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 FPUTS: | |
22 pshs a,x,y,u | |
23 tfr x,u start of 1st segment to print | |
24 | |
25 loop | |
26 pshs u start of this segment | |
27 ldy #-1 size of this seg. | |
28 | |
29 l1 | |
30 leay 1,y count size | |
31 ldb ,u+ check for null/cr | |
32 beq doit null=do last seg. | |
33 cmpb #$0d cr=do this seg. | |
34 bne l1 | |
35 leay 1,y count CR as one of the ones to print | |
36 | |
37 doit | |
38 puls x get start of this segment | |
39 OS9 I$WritLn | |
40 bcs exit | |
41 tst -1,u at end? | |
42 bne loop | |
43 | |
44 exit | |
45 puls a,x,y,u,pc return with status in CC,error code in B | |
46 | |
47 endsect |