English
Language : 

NSB8 Datasheet, PDF (76/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
grifo®
ITALIAN TECHNOLOGY
INP (<numeric expression>)
This function performs an 8080 or Z80 IN instruction from the input port specified by the argument
value. The numeric value returned by the function is the contents of the accumulator (in the range
of 0 to 255) after the IN instruction. Note that INP will not wait for valid data, as do INCHAR$,
INPUT, and INPUT1, but instead fetches whatever byte value exists at the input port, whether or not
that value represents useful data.
CIO=INP(128)
<status>=CALL(17200,<acquire>)
This function checks if the console input device has a character ready and it manages its acquisition
according with <acquire> numeric parameter. The result of this check is returned in the numeric
variable <status>, with the following meaning:
<status> = 0 -> no character available;
<status> > 255 -> one character available; in this condition if:
<acquire> = 0 -> the available character is not acquired;
<acquire> = 1 -> the available character is acquired and returned on
the <status> low byte.
To correctly use this function, the special keys management must be disabled (see discussion:
CONTROL-C, THE PANIC BUTTON).
Example:
10 IF CALL(17200,0)=0 THEN GOTO 10 \ REM Wait one character with no acquisition
20 IF CALL(17200,1)=0 THEN GOTO 20 \ REM Wait one character with acquisistion
30 T=CALL(17200,1) \ REM Check if character available and acquire it
40 IF T>255 THEN T=T-256 \ REM If character available, calculates its numeric code
<not used>=CALL(17152,<I/O add.>)
This function define the 16 bit I/O address for the other input output functions. The <I/O add.>
parameter should evaluate to an integer from 0 to 65535, while the returned value is not significant.
10 H=CALL(17152,12) \ REM Sets I/O address = 12 = 000CH
<data in>=CALL(17168)
This function perform an input operation, at the 16 bit address specified by the previous function,
and it returns the acquired value (an integer from 0 to 255) on the numeric variable <data in>.
20 I=CALL(17168) \ REM Get input at 000CH address and saves it on I variable
<not used>=CALL(17184,<data out>)
This function perform an output operation, at the 16 bit address defined by the first function, with
the value of the numeric variable <data out> (an integer from 0 to 255).
30 H=CALL(17184,0) \ REM Performs output at 000CH address with the value 0
Page 64
NSB8
Rel. 5.10