Subtract Y-X/Subtract Y-X With Borrow - Analog Devices adsp-2100 Manual

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

SUBTRACT Y-X / SUBTRACT Y-X with BORROW
Syntax:
[ IF cond ]
Permissible xops
AX0
MR2
AX1
MR1
AR
MR0
SR1
SR0
Permissible constants (ADSP-217x, ADSP-218x, ADSP-21msp58/59 only)
0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32767
–2, –3, –5, –9, –17, –33, –65, –129, –257, –513, –1025, –2049, –4097, –8193, –16385, –
32768
Example:
IF GT AR = AY0 – AX0 + C – 1;
Description:
Test the optional condition and, if true, then perform the
specified subtraction. If the condition is not true then perform a no-operation.
Omitting the condition performs the subtraction unconditionally. The
subtraction operation subtracts the second source operand from the first
source operand, optionally adds the ALU Carry bit (AC) minus 1 (H#0001),
and stores the result in the destination register. The (C–1) quantity effectively
implements a borrow capability for multiprecision subtractions. The
operands are contained in the data registers or constant specified in the
instruction.
The –xop + constant operation is only available on the ADSP-217x, ADSP-218x,
and ADSP-21msp58/59 processors and may not be used in multifunction
instructions.
Status Generated:
ASTAT:
7
6
SS MV AQ AS
AZ
Set if the result equals zero. Cleared otherwise.
AN
Set if the result is negative. Cleared otherwise.
AR
= yop –
AF
Permissible yops
AY0
AY1
AF
5
4
3
AC AV AN AZ
*
(instruction continues on next page)
xop
xop + C – 1
–xop + C – 1
–xop + constant
–xop + constant + C – 1
Permissible conds (see Table 15.9)
EQ
LE
NE
NEG
GT
POS
GE
AV
LT
NOT AV NOT CE
2
1
0
*
*
*
ALU
;
AC
NOT AC
MV
NOT MV
15
15 – 25

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents