OUT

BASin

OUT OUTput to port

Statement/Command

OUT sends a byte to a given input/output port address in order to drive an output device.

How to use OUT

OUT may be used to form a statement or as a direct command. It is followed by two numeric values, separated by a comma, for example

40 OUT 254,3

Both values are rounded to the nearest integer. The first value (254 above) may then range from 0 to 65535 and is the port address. The second value (3) may range from 0 to 255 and this is the byte to be sent to the port address.

Bits 0 to 2 of the byte output to port 254 set the border colour; the above example therefore turns the border magenta. Bit 3 at this address drives the MIC output, and bit 4 the loudspeaker (for BEEP). Port address 251 drives the printer and ports 254, 247 and 239 are used with other peripherals.

Format

  • OUT int-num-expr,int-num-expr

See also

Chapter 23.