
Port Definitions
66
PRELIMINARY V1.8
TABLE 38.
Port 1 and Port 3 Functions
The alternate functions for NWR, NRD can only be activated if the corresponding port
bit latch (P3.6, P3.7) in the port SFR contains a 1 (high, initial value). Otherwise the
port pin is stuck at 0 (low).
14.2.
Read-Modify-Write Feature
Some instructions, that read a port (Port-0 to 3 only), read the latch and others read pin.
The instructions that read the latch rather than the pin are the ones that read a value,
possibly change it, and then rewrite it to the latch. These are called “read-modify-write”
instructions. The instructions listed below are read-modify-write instructions. When the
destination operand is a port, or a port bit, these instructions read the latch than the pin:
P3.2
CPTRD1
P3.3
TXEN
P3.4
MODOUT
P3.5
DI
P3.6
IRQ1, NWR (External Data Memory Write Strobe)
P3.7
IRQ2, NRD (External Data Memory Read Strobe)
INSTRUCTIONS
DESCRIPTION
ANL
logical AND, e.g. ANL P0, A
ORL
logical OR, e.g. ORL P1, A
XRL
logical EX-OR, e.g. XRL P2, A
JBC
jump if bit = 1 and clear bit, e.g. JBC P3.0, LABEL
CPL
complement bit, e.g. CPL P3.1
INC
increment, e.g. INC P0
DEC
decrement, e.g. DEC P1
DJNZ
decrement and jump if not zero, e.g. DJNZ P0,
LABEL
MOV PX.Y, C
move carry bit to bit Y of Port-X
CLR PX.Y
clear bit Y of Port-X
PORT BIT
ALTERNATE FUNCTION