6.5 I/O Usage
6.5.1 Write I/O Port
The chip's I/O port register, like the general universal register, can be written through data transmission
instructions, bit manipulation instructions, etc.
Example: write I/O port program
;pass value of ACC to PORTA
;set all output port of PORTA as 1
6.5.2 Read I/O Port
Example: write I/O port program
;pass value of PORTA to ACC
; check whether PORTA, port 1 is 1, if it is 1, skip the next
statement
; check if PORTA, 1 port is 0, if 0, skip the next statement
Note: When the user reads the status of an I/O port, if the I/O port is an input port, the data read back
by the user will be the state of the external level of the port line. If the I/O port is an output port
then the read value will be the data of the internal output register of this port.