# PORT()

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 Picomite CMM2

Syntax:
PORT(start, nbr [,start, nbr] ...) = value
value = PORT(start, nbr [,start, nbr]...)

Description:

PORT(start, nbr [,start, nbr] ...) = value
Set a number of I/O pins simultaneously (ie, with one command).
'start' is an I/O pin number and the lowest bit in 'value' (bit 0) will be used to set that pin. Bit 1 will be used to set the pin 'start' plus 1, bit 2 will set pin 'start'+2 and so on for 'nbr' number of bits.
I/O pins used must be numbered consecutively and any I/O pin that is invalid or not configured as an output will cause an error.
The start/nbr pair can be repeated if an additional group of output pins needed to be added.
For example;
PORT(15, 4, 23, 4) = &B10000011
Will set eight I/O pins. Pins 15 and 16 will be set high while 17, 18, 23, 24 and 25 will be set to a low and finally 26 will be set high.
This command can be used to conveniently communicate with parallel devices like LCD displays.
Any number of I/O pins (and therefore bits) can be used from 1 to the number of I/O pins on the chip.

value = PORT(start, nbr [,start, nbr]...)
Returns the value of a number of I/O pins in one operation.
'start' is an I/O pin number and its value will be returned as bit 0. 'start'+1 will be returned as bit 1, 'start'+2 will be returned as bit 2, and so on for 'nbr' number of bits.
I/O pins used must be numbered consecutively and any I/O pin that is invalid or not configured as an input will cause an error.
The start/nbr pair can be repeated up to 25 times if additional groups of input pins need to be added. This function will also return the state of a pin configured as an output.
It can be used to conveniently communicate with parallel devices like memory chips.
Any number of I/O pins (and therefore bits) can be used from 1 to the number of I/O pins on the chip

Last edited: 30 September, 2020