ST10 FAMILY PROGRAMMING MANUAL
168/172
CoSUB(2)(R)
Subtract
Group
Arithmetic Instructions
Syntax
CoSUB
op1, op2
Operation
(tmp)
<--
(op2)\(op1)
(ACC)
<-- (ACC) - (tmp)
Syntax
CoSUB2
op1, op2
Operation
(tmp)
<-- 2 * (op2)\(op1)
(ACC)
<-- (ACC) - (tmp)
Syntax
CoSUBR
op1, op2
Operation
(tmp)
<--
(op2)\(op1)
(ACC)
<-- (tmp) - (ACC)
Syntax
CoSUB2R
op1, op2
Operation
(tmp)
<-- 2 * (op2)\(op1)
(ACC)
<-- (tmp) - (ACC)
Data Types
DOUBLE WORD
Result
40-bit signed value
Description
Subtracts a 40-bit operand from the 40-bit Accumulator contents or vice-versa when the “R” option is
used, and stores the result in the accumulator. The 40-bit operand results from the concatenation of the
two source operands op1 (LSW) and op2 (MSW), which is then sign-extended. The “2” option indicates
that the 40-bit operand is also multiplied by 2, prior to being subtracted/added from/to the ACC/negated
ACC. When the most significant bit of the MCW register is set and when a 32-bit overflow or underflow
occurs, the obtained result becomes 00 7FFF FFFF
h
or FF 8000 0000
h
, respectively. This instruction is
repeatable with indirect addressing modes, and allows up to two parallel memory reads
MAC Flags
Note: The E-flag is set when the nine highest bits of the accumulator are not equal. The SV-flag is set,
when a 40-bit arithmetic overflow/ underflow occurs.
N
Z
C
SV
E
SL
*
*
*
*
*
*
N
Set if the most significant bit of the result is set. Cleared otherwise.
Z
Set if the result equals zero. Cleared otherwise.
C
Set if a borrow is generated. Cleared otherwise.
SV
Set if an arithmetic overflow occurred. Not affected otherwise.
E
Set if the MAE is used. Cleared otherwise.
SL
Set if the contents of the ACC is automatically saturated. Not affected otherwise.
Содержание ST10 Series
Страница 2: ......
Страница 4: ...ST10 FAMILY PROGRAMMING MANUAL 2 172...