PROGRAMMING MANUAL CoASHR
151/197
CoASHR Accumulator Arithmetic Shift Right with Optional Round
Group Shift Instructions
Syntax CoASHRop1
CoASHRop1, rnd
Operation (count) <-- (op1)
(C) <-- 0
DO WHILE (count) 0
(ACC
n
) <-- (ACC
n+1
) [n=0-38]
(count) <-- (count) -1
END WHILE
IF (rnd) THEN
(ACC) <-- (ACC) + 00008000
H
(MAL) <-- 0
END IF
Data Types ACCUMULATOR
Result 40-bit signed value
Description Arithmetically shifts the ACC register right by as many times as
specified by the operand op1. To preserve the sign of the ACC
register, the most significant bits of the result are filled with sign 0 if
the original most significant bit was a 0 or with sign
1 if the original
most significant bit was 1. Only shift values between 0 and 8 are
allowed. “op1” can be either a 5-bit unsigned immediate data, or the
least significant 5 bits (considered as unsigned data) of any register
directly or indirectly addressed operand. Without “rnd” option, the MS
bit of the MCW register does not affect the result. While with “rnd”
option and if the MS bit 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 when “op 1” is not
an immediate operand.
MAC Flags
N Z C SV E SL
* * * * * *
N Set if the most significant bit of the result is set. Cleared other-
wise.
Z Set if the result equals zero. Cleared otherwise.
C Set if a carry is generated (rnd). Cleared otherwise.
SV Set if an arithmetic overflow occurred (rnd). Not affected other-
wise.
E Set if the MAE is used. Cleared otherwise.
SL Set if the contents of the ACC is automatically saturated (rnd).
Not affected otherwise
2