![](http://datasheet.mmic.net.cn/320000/US5A10AS17K_datasheet_16363432/US5A10AS17K_103.png)
CHAPTER 11 ARITHMETIC AND LOGIC UNIT
88
Table 11-1. List of ALU Instructions (1/2)
ALU Functions
Instruction
Operation
Explanation
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.
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.
OR r, m
(r)
←
(r) (m)
OR operation is performed on contents of general
register and data memory. Result is stored in general
register.
OR m, #n4
(m)
←
(m) n4
OR operation is performed on immediate data and
contents of data memory. Result is stored in data
memory.
AND r, m
(r)
←
(r) (m)
AND operation is performed on contents of general
register and data memory. Result is stored in general
register.
AND m, #n4
(m)
←
(m) n4
AND operation is performed on immediate data and
contents of data memory. Result is stored in data
memory.
XOR r, m
(r)
←
(r) (m)
XOR operation is performed on contents of general
register and data memory. Result is stored in general
register.
XOR m, #n4
(m)
←
(m) n4
XOR operation is performed on immediate data and
contents of data memory. Result is stored in data
memory.
TRUE
SKT m, #n
CMP
←
0, if (m) n=n,
then skip
CMP
←
0, if (m) n=0,
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
Skips next instruction if all bits in data memory
specified by n are FALSE (0). Result is not stored.
Equal
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 borrow
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
RORC r
Rotate contents of the general register along with
the CY flag to the right. Result is stored in general
register.
Bit
judge-
ment
Rotate
to the
right
Arith-
metic
opera-
tions
Addi-
tion
Sub-
traction
Logical
opera-
tions
Logical
OR
Logical
AND
Logical
XOR
CY
→
(r)
b3
→
(r)
b2
→
(r)
b1
→
(r)
b0
Com-
parison
judge-
ment