![](http://datasheet.mmic.net.cn/370000/UPD17134ACT-xxx_datasheet_16740627/UPD17134ACT-xxx_105.png)
CHAPTER 11 ARITHMETIC AND LOGIC UNIT (ALU)
86
Table 11-1. List of ALU Instructions (1/2)
ALU function
Instruction
Operation
Explanation
Arithmetic
operations
Addition
ADD r, m
(r)
←
(r) + (m)
Adds contents of general register and data memory.
Result is stored in general register.
ADD m, #n4
(m)
←
(m) + n4
Adds immediate data to contents of data memory.
Result is stored in data memory.
ADDC r, m
(r)
←
(r) + (m) + CY
Adds contents of general register, data memory and carry
flag. Result is stored in general register.
ADDC m,
#n4
(m)
←
(m) + n4 + CY
Adds immediate data, contents of data memory and carry
flag. Result is stored in data memory.
Subtraction SUB r, m
(r)
←
(r) – (m)
Subtracts contents of data memory from contents of general
register. Result is stored in general register.
SUB m, #n4
(m)
←
(m) – n4
Subtracts immediate data from data memory.
Result is stored in data memory.
SUBC r, m
(r)
←
(r) – (m) – CY
Subtracts contents of data memory and carry flag from
contents of general register. Result is stored in general
register.
SUBC m,
#n4
(m)
←
(m) – n4 – CY
Subtracts immediate data and carry flag from data memory.
Result is stored in data memory.
Logical
operations
Logical
OR
OR r, m
(r)
←
(r) v (m)
OR operation is performed on contents of general register
and data memory. Result is stored in general register.
OR m, #n4
(m)
←
(m) v n4
OR operation is performed on immediate data and contents
of data memory. Result is stored in data memory.
Logical
AND
AND r, m
(r)
←
(r) v
AND operation is performed on contents of general register
and data memory. Result is stored in general register.
AND m, #n4
(m)
←
(m) v
AND operation is performed on immediate data and contents
of data memory. Result is stored in data memory.
Logical
XOR
XOR r, m
(r)
←
(r) v (m)
XOR operation is performed on contents of general register
and data memory. Result is stored in general register.
XOR m, #n4
(m)
←
(m) v n4
XOR operation is performed on immediate data and contents
of data memory. Result is stored in data memory.
Bit
Judgement
True
SKT m, #n
CMP
←
0, if (m)v
then skip
Skips next instruction if all bits in data memory specified by
n are TRUE (1). Result is not stored.
False
SKF m, #n
CMP
←
0, if (m)v
then skip
Skips next instruction if all bits in data memory specified by
n are FALSE (0). Result is not stored.
Comparison Equal
judgement
SKE m, #n4
(m) – n4, skip if zero
Skips next instruction if immediate data equals contents of
data memory. Result is not stored.
Not equal
SKNE m,
#n4
(m) – n4, skip if not
zero
Skips next instruction if immediate data is not equal to
contents of data memory. Result is not stored.
≥
SKGE m,
#n4
(m) – n4, skip if not
Skips next instruction if contents of data memory is greater
than or equal to immediate data. Result is not stored.
<
SKLT m,
#n4
(m) – n4, skip if
borrow
Skips next instruction if contents of data memory is less
than immediate data. Result is not stored.
Rotation
Rotate to
the right
RORC r
Rotate contents of the general register along with the CY
flag to the right. Result is stored in general register.
CY
→
(r)
b3
→
(r)
b2
→
(r)
b1
→
(r)
b0