CHAPTER 11 ARITHMETIC AND LOGIC UNIT
93
11.2.6 Performing Operations in the ALU Block
When arithmetic operations, logical operations, bit evaluations, comparison evaluations or rotations in a program
are executed, the first data operand is stored in temporary register A and the second data operand is stored in
temporary register B.
The first data operand is four bits of data used to specify the contents of an address in the general register or
data memory. The second data operand is four bits of data used to either specify the contents of an address in data
memory or to be used as an immediate value. For example, in the instruction
ADD r, m
Second data operand
First data operand
the first data operand, r, is used to specify the contents of an address in the general register. The second data operand,
m, is used to specify the contents of an address in data memory. In the instruction
ADD m, #n4
the first data operand, m, is used to specify an address in data memory. The second operand, #n4, is immediate
data. In the rotation instruction
RORC r
only the first data operand, r (used to specify the contents of an address in the general register) is used.
Next, using the data stored in temporary registers A and B, the ALU executes the operation specified by the
instruction (arithmetic operation, logical operation, bit evaluation, comparison evaluation, or rotation). When the
instruction being executed is an arithmetic operation, logical operation, or rotation, the data processed by the ALU
is stored in the location specified by the first data operand (general register address or data memory address) and
the operation terminates. When the instruction being executed is a bit evaluation or comparison evaluation, the result
processed by the ALU is used to determine whether or not to skip the next instruction (whether to treat next
instruction as a no operation instruction: NOP) and the operation terminates.
Summary of Contents for mPD17120 Subseries
Page 15: ... x MEMO ...
Page 23: ... MEMO 8 ...
Page 45: ... MEMO 30 ...
Page 49: ... MEMO 34 ...
Page 55: ... MEMO 40 ...
Page 93: ... MEMO 78 ...
Page 99: ... MEMO 84 ...
Page 102: ...CHAPTER 11 ARITHMETIC AND LOGIC UNIT 87 MEMO ...
Page 119: ... MEMO 104 ...
Page 175: ... MEMO 160 ...
Page 199: ... MEMO 184 ...
Page 265: ... MEMO 250 ...
Page 281: ...266 MEMO ...
Page 285: ... MEMO 270 ...
Page 289: ... MEMO 274 ...