Mercurial > hg > Members > kono > nitros9-code
annotate lib/alib/fgets.as @ 3100:ed4c9b04f74e
makefile: Remove hg update commands
We don't want makefiles to play with mercurial commands.
Particularly not when we are about to push a snapshot.
author | Tormod Volden <debian.tormod@gmail.com> |
---|---|
date | Sun, 28 Feb 2016 21:37:42 +0100 |
parents | 03f26e88b809 |
children |
rev | line source |
---|---|
2783
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
1 *************************************** |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
2 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
3 * Subroutine to input a null terminated string. |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
4 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
5 * OTHER MODULES NEEDED: none |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
6 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
7 * ENTRY: A=path |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
8 * X=buffer for string |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
9 * Y=max buffer size (leave room for null!!) |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
10 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
11 * EXIT: CC carry set if error (from I$ReadLn) |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
12 * B error code if any |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
13 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
14 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
15 * NOTE: The string entered must end with an end-of-record char |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
16 * (usually a $0D), the null is appended for ease in string |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
17 * handling. |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
18 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
19 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
20 nam Input Null Terminated String |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
21 ttl Assembler Library Module |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
22 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
23 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
24 section .text |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
25 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
26 FGETS_NOCR: |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
27 pshs d,x |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
28 bsr FGETS |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
29 bcs bye |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
30 tfr y,d |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
31 leax -1,x |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
32 clr d,x |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
33 bye puls d,x,pc |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
34 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
35 FGETS: |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
36 pshs a,x |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
37 os9 I$ReadLn get line |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
38 bcs exit return error code |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
39 tfr y,d |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
40 clr d,x add null |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
41 clrb no error.. |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
42 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
43 exit |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
44 puls a,x,pc |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
45 |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
46 endsect |
03f26e88b809
Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff
changeset
|
47 |