UPI-41A/41AH/42/42AH USER’S MANUAL
Table 3-2. Instruction Set Summary
Mnemonic
Description
Bytes Cycle
ACCUMULATOR
ADD A, Rr
Add register to A
1
1
ADD A,
@
Rr
Add data memory to A
1
1
ADD A,
Ý
data
Add immediate to A
2
2
ADDC A, Rr
Add register to A with carry
1
1
ADDC A,
@
Rr
Add data memory to A
with carry
1
1
ADDC A,
Add immediate to A
Ý
data
with carry
2
2
ANL A, Rr
And register to A
1
1
ANL A,
@
Rr
And data memory to A
1
1
ANL A,
Ý
data
And immediate to A
2
2
ORL A, Rr
Or register to A
1
1
ORL A,
@
Rr
Or data memory to A
1
1
ORL A,
Ý
data
Or immediate to A
2
2
XRL A, Rr
Exclusive Or
register to A
1
1
XRL A,
@
Rr
Exclusive Or data
memory to A
1
1
XRL A,
Ý
data
Exclusive Or
immediate to A
2
2
INC A
Increment A
1
1
DEC A
Decrement A
1
1
CLR A
Clear A
1
1
CPL A
Complement A
1
1
DA A
Decimal Adjust A
1
1
SWAP A
Swap nibbles of A
1
1
RL A
Rotate A left
1
1
RLC A
Rotate A left
through carry
1
1
RR A
Rotate A right
1
1
RRC A
Rotate A right
through carry
1
1
INPUT/OUTPUT
IN A, Pp
Input port to A
1
2
OUTL Pp, A
Output A to port
1
2
ANL Pp,
Ý
data
And immediate to port
2
2
ORL Pp,
Ý
data
Or immediate to port
2
2
IN A,DBB
Input DDB to A, clear IBF
1
1
OUT DBB, A
Output A to DBB, Set OBF
1
1
MOV STS,A
A
4
– A
7
to bits 4 – 7 of status
1
1
MOVD A,Pp
Input Expander port to A
1
2
MOVD Pp,A
Output A to Expander port
1
2
ANLD Pp,A
And A to Expander port
1
2
ORLD Pp,A
Or A to Expander port
1
2
DATA MOVES
MOV A, Rr
Move register to A
1
1
MOV A,
@
Rr
Move data memory to A
1
1
MOV A,
Ý
data
Move immediate to A
2
2
MOV Rr, A
Move A to register
1
1
MOV
@
Rr, A
Move A to data memory
1
1
MOV Rr,
Ý
data
Move immediate to register
2
2
MOV
@
Rr,
Move immediate to
Ý
data
data memory
2
2
MOV A, PSW
Move PSW to A
1
1
MOV PSW, A
Move A to PSW
1
1
XCH A, Rr
Exchange A and registers
1
1
XCH A,
@
Rr
Exchange A and
data memory
1
1
XCHD A,
Exchange digit of A
@
Rr
and register
1
1
Mnemonic
Description
Bytes
Cycle
DATA MOVES
(Continued)
MOVP A,
@
A
Move to A from current
page
1
2
MOVP3 A,
Move to A from page 3
1
2
@
A
TIMER/COUNTER
MOV A,T
Read Timer/Counter
1
1
MOV T,A
Load Timer/Counter
1
1
STRT T
Start Timer
1
1
STRT CNT
Start Counter
1
1
STOP TCNT
Stop Timer/Counter
1
1
EN TCNTI
Enable Timer/Counter
1
1
DIS TCNTI
Disable Timer/Counter
1
1
Interrupt
CONTROL
EN DMA
Enable DMA Handshake
Lines
1
1
EN I
Enable IBF interrupt
1
1
DIS I
Disable IBF interrupt
1
1
EN FLAGS
Enable Master Interrupts
1
1
SEL RB0
Select register bank 0
1
1
SEL RB1
Select register bank 1
1
1
NOP
No Operation
1
1
REGISTERS
INC Rr
Increment register
1
1
INC
@
Rr
Increment data memory
1
1
DEC Rr
Decrement register
1
1
SUBROUTINE
CALL addr
Jump to subroutine
2
2
RET
Return
1
2
RETR
Return and restore status
1
2
FLAGS
CLR C
Clear Carry
1
1
CPL C
Complement Carry
1
1
CLR F0
Clear Flag 0
1
1
CPL F0
Complement Flag 0
1
1
CLR F1
Clear F
1
Flag
1
1
CPL F1
Complement F
1
Flag
1
1
BRANCH
JMP addr
Jump unconditional
2
2
JMPP
@
A
Jump indirect
1
2
DJNZ Rr,
Decrement register
addr
and jump on non-zero
2
2
JC addr
Jump on Carry
e
1
2
2
JNC addr
Jump on Carry
e
0
2
2
JZ addr
Jump on A zero
2
2
JNZ addr
Jump on A not zero
2
2
JT0 addr
Jump on T
0
e
1
2
2
JNT0 addr
Jump on T
0
e
0
2
2
JT1 addr
Jump on T
1
e
1
2
2
JNT1 addr
Jump on T
1
e
0
2
2
JF0 addr
Jump on F
0
Flag
e
1
2
2
JF1 addr
Jump on F
1
Flag
e
1
2
2
JTF addr
Jump on Timer Flag
e
1
2
2
JNIBF addr
Jump on IBF Flag
e
0
2
2
JOBF addr
Jump on OBF Flag
e
1
2
2
JBb addr
Jump on Accumulator Bit
2
2
29