15
Instruction Set Reference
15 – 9
15.5
ALU, MAC & SHIFTER INSTRUCTIONS
This group of instructions performs computations. All of these
instructions can be executed conditionally except the ALU division
instructions and the Shifter SHIFT IMMEDIATE instructions.
15.5.1
ALU Group
Here is an example of one ALU instruction, Add/Add with Carry:
IF AC AR=AX0+AY0+C;
The (optional) conditional expression, IF AC, tests the ALU Carry bit
(AC); if there is a carry from the previous instruction, this instruction
executes, otherwise a NOP occurs and execution continues with the next
instruction. The algebraic expression AR=AX0+AY0+C means that the
ALU result register (AR) gets the value of the ALU X input and Y input
registers plus the value of the carry-in bit.
Table 15.3 gives a summary list of all ALU instructions. In this list,
condition stands for all the possible conditions that can be tested and xop
and yop stand for the registers that can be specified as input for the ALU.
The conditional clause is optional and is enclosed in square brackets to
show this. A complete list of the permissible xops and yops is given in the
reference page for each instruction. A complete list of conditions is given
in Table 15.9.
ALU Instructions
[IF condition]
AR
=
xop
+ yop
;
AF
+ C
+ yop + C
+ constant
+ co C
[IF condition]
AR
=
xop
– yop
;
AF
– yop + C – 1
+ C – 1
– constant
– co C – 1
[IF condition]
AR
=
yop
– xop
;
AF
– xop + C – 1
– xop + C – 1
– xop + constant
– xop + co C – 1