PORT P0..P4
Px allows you to read or write individual pins using the NXP assigned
port and pin number. When Pn (expression) is read, the logic
state of the pin corresponding to expression is returned.
When assigning a value to Pn(expression), then pin expression is set to that value if that pin has been assigned to be an output by writing to FIOxDIR.
When read Pn(x) returns a 0 or -1. Why -1 and 0? The main reason is that operations of operators like NOT are assumed to be bit-wise until there is a Boolean operation in the expression, and NOT 0 is equal to -1. When setting a pin state with Pn(x) = 0 then the pin becomes low, any other value and the pin becomes high, so Pn(x) =1 and Pn(x) = -1 both set the pin high.
These pin numbers correspond to the port pin assignments from NXP.
This feature is part of the compiler and requires version 8.04c or later. It has not been added to the on-chip compiler of the ARMweb. Access to IO pins using Px commands is optimized by the compiler for the SuperPRO and PROplus. These do work for the BASICchip, but have not been optimized yet.
On the SuperPRO and PROplus: