UPI-41A/41AH/42/42AH USER’S MANUAL
external clock applied to the TEST 1 pin. The instruc-
tion executed determines which clock source is used. A
single instruction stops the counter whether it is operat-
ing with an internal or an external clock source. In
addition, two instructions allow the timer interrupt to
be enabled or disabled.
Subroutines
Subroutines are entered by executing a call instruction.
Calls can be made to any address in the 1K word pro-
gram memory. Two separate return instructions deter-
mine whether or not status (i.e., the upper 4 bits of the
PSW) is restored upon return from a subroutine.
Input/Output Instructions
Two 8-bit data bus buffer registers (DBBIN and
DBBOUT) and an 8-bit status register (STS) enable the
UPI-41A universal peripheral interface to communi-
cate with the external microcomputer system. Data can
be INputted from the DBBIN register to the accumula-
tor. Data can be OUTputted from the accumulator to
the DBBOUT register.
The STS register contains four user-definable bits
(ST
4
– ST
7
) plus four reserved status bits (IBF, OBF, F
0
and F
1
). The user-definable bits are set from the accu-
mulator.
The UPI-41A/41AH/42/42AH peripheral interface
has two 8-bit static I/O ports which can be loaded to
and from the accumulator. Outputs are statically
latched but inputs to the ports are sampled at the time
an IN instruction is executed. In addition, immediate
data from program memory can be ANDed and ORed
directly to PORTS 1 and 2 with the result remaining on
the port. This allows ‘‘masks’’ stored in program mem-
ory to be used to set or reset individual bits on the I/O
ports. PORTS 1 and 2 are configured to allow input on
a given pin by first writing a ‘‘1’’ to the pin.
Four additional 4-bit ports are available through the
8243 I/O expander device. The 8243 interfaces to the
UPI-41A/41AH/42/42AH peripheral interface via
four PORT 2 lines which form an expander bus. The
8243 ports have their own AND and OR instructions
like the on-board ports, as well as move instructions to
transfer data in or out. The expander AND or OR in-
structions, however, combine the contents of the accu-
mulator with the selected port rather than with imme-
diate data as is done with the on-board ports.
INSTRUCTION SET DESCRIPTION
The following section provides a detailed description of
each UPI instruction and illustrates how the instruc-
tions are used.
For further information about programming the UPI,
consult the
8048/8041AH Assembly Language Manual.
Table 3-1. Symbols and Abbreviations Used
Symbol
Definition
A
Accumulator
C
Carry
DBBIN Data Bus Buffer Input
DBBOUT Data Bus Buffer Output
F
0
, F
1
FLAG 0, FLAG 1 (C/D flag)
I
Interrupt
P
Mnemonic for ‘‘in-page’’ operation
PC
Program Counter
Pp
Port designator (p
e
1, 2, or 4 – 7)
PSW
Program Status Word
Rr
Register designator (r
e
0 – 7)
SP
Stack Pointer
STS
Status register
T
Timer
TF
Timer Flag
T
0
, T
1
TEST 0, TEST 1
Ý
Immediate data prefix
@
Indirect address prefix
(( ))
Double parentheses show the effect of
@
,
that is
@
RO is shown as ((RO)).
( )
Contents of
28