English
Language : 

NSB8 Datasheet, PDF (59/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
ITALIAN TECHNOLOGY
grifo®
OUT
STATEMENT:
OUT <port number>, <byte value>
ACTION:
The byte value is sent to the indicated 8080 or Z80 output port. Both port number and byte values
must be numeric expression which evaluate to integers from 0 to 255.
EXAMPLES:
OUT 2,65
OUT P,B
OUT P7+1, ASC(”0”)
REMARKS:
Both the port number and the byte value must be decimal (base 10) numbers (refer to statement FILL
for further elaboration on this).
Frequently it is necessary to determine whether or not a given output port is ready to receive data,
by examining a special input port (called a STATUS PORT) for evidence of a ready signal. The built
in function INP may be used to facilitate this. In such circumstances, a program should wait until the
ready signal is given before executing an OUT statement. This process of waiting and outing is called
handshaking. If OUT is used before the signal is received, the byte value may be lost before arriving
at its proper output destination. The OUT statement does not provide its own handshaking, it is the
programmer’s responsibility to determine whether or not handshaking logic is necessary when
communicating with a particular output port, and to implement it with the appropriate statements if
so.
The PRINT and OUT statements do very different things and should not be confused with each other.
ERROR MESSAGES:
OUT OF BOUNDS ERROR
One or both of the values specified lies outside the range of 0 to 255.
SEE ALSO:
Section FUNCIONS (in detail built in INP function)
Statement FILL
NSB8
Rel. 5.10
Page 47