2474
|
1 ***************************************
|
|
2
|
|
3 * Subroutine to input one character from std in. if ready
|
|
4 * like an INKEY$...
|
|
5
|
|
6 * OTHER MODULES NEEDED: FGETC
|
|
7
|
|
8 * ENTRY: none
|
|
9
|
|
10
|
|
11 * EXIT: A character, 0=no char
|
|
12 * CC carry set if error (from I$Read)
|
|
13 * B error code if any
|
|
14
|
|
15 nam Inkey
|
|
16 ttl Assembler Library Module
|
|
17
|
|
18
|
|
19 psect INKEY,0,0,0,0,0
|
|
20
|
|
21 INKEY:
|
|
22 clra std in
|
|
23 ldb #SS.Ready
|
|
24 os9 I$GetStt see if key ready
|
|
25 bcc getit
|
|
26 cmpb #E$NotRdy no keys ready=no error
|
|
27 bne exit other error, report it
|
|
28 clra no error
|
|
29 bra exit
|
|
30
|
|
31 getit
|
|
32 lbsr FGETC go get the key
|
|
33
|
|
34 * this inst. needed since ctrl/: sometimes returns a null
|
|
35 * usually callers are not expecting a null....
|
|
36
|
|
37 tsta
|
|
38
|
|
39 exit
|
|
40 rts
|
|
41
|
|
42 endsect
|
|
43
|