Mercurial > hg > Members > kono > nitros9-code
annotate lib/alib/inkey.as @ 2831:7c8442122235 lwtools-port
fix level 1 builds
author | lfantoniosi |
---|---|
date | Tue, 18 Jun 2013 21:41:46 -0400 |
parents | 03f26e88b809 |
children |
rev | line source |
---|---|
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 | |
2782
aaba193af04f
Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2474
diff
changeset
|
19 section .text |
2474 | 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 |