2474
|
1 ***************************************
|
|
2
|
|
3 * Subroutine to input a null terminated string.
|
|
4
|
|
5 * OTHER MODULES NEEDED: none
|
|
6
|
|
7 * ENTRY: A=path
|
|
8 * X=buffer for string
|
|
9 * Y=max buffer size (leave room for null!!)
|
|
10
|
|
11 * EXIT: CC carry set if error (from I$ReadLn)
|
|
12 * B error code if any
|
|
13
|
|
14
|
|
15 * NOTE: The string entered must end with an end-of-record char
|
|
16 * (usually a $0D), the null is appended for ease in string
|
|
17 * handling.
|
|
18
|
|
19
|
|
20 nam Input Null Terminated String
|
|
21 ttl Assembler Library Module
|
|
22
|
|
23
|
|
24 psect FGETS,0,0,0,0,0
|
|
25
|
|
26 FGETS_NOCR:
|
|
27 pshs d,x
|
|
28 bsr FGETS
|
|
29 bcs bye
|
|
30 tfr y,d
|
|
31 leax -1,x
|
|
32 clr d,x
|
|
33 bye puls d,x,pc
|
|
34
|
|
35 FGETS:
|
|
36 pshs a,x
|
|
37 os9 I$ReadLn get line
|
|
38 bcs exit return error code
|
|
39 tfr y,d
|
|
40 clr d,x add null
|
|
41 clrb no error..
|
|
42
|
|
43 exit
|
|
44 puls a,x,pc
|
|
45
|
|
46 endsect
|
|
47
|