ST10 FAMILY PROGRAMMING MANUAL
131/172
CoASHR
Accumulator Arithmetic Shift Right
with Optional Round
Group
Shift Instructions
Syntax
CoASHRop1
CoASHR
op1, 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 (con-
sidered 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
Addressing Modes
Examples
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 carry is generated (rnd). Cleared otherwise.
SV
Set if an arithmetic overflow occurred (rnd). Not affected otherwise.
E
Set if the MAE is used. Cleared otherwise.
SL
Set if the contents of the ACC is automatically saturated (rnd). Not affected otherwise
Mnemonic
Rep
Format
Bytes
CoASHR
Rw
n
Yes
A3 nn AA rrrr:r000
4
CoASHR
Rw
n
, rnd
Yes
A3 nn BA rrrr:r000
4
CoASHR
#data
5
No
A3 00 A2 ssss:s000
4
CoASHR
#data
5
, rnd
No
A3 00 B2 ssss:s000
4
CoASHR
[Rw
m
⊗
]
Yes
83 mm AA rrrr:rqqq
4
CoASHR
[Rw
m
⊗
], rnd
Yes
83 mm BA rrrr:rqqq
4
CoASHR
#3, rnd
; (ACC) <-- (ACC) >>a 3 + rnd
CoASHR
R3
; (ACC) <-- (ACC) >>a (R3)
4-0
CoASHR
[R10 - QR0]
; (ACC) <-- (ACC) >>a ((R10))
4-0
; (R10) <-- (R10) - (QR0)
Содержание ST10 Series
Страница 2: ......
Страница 4: ...ST10 FAMILY PROGRAMMING MANUAL 2 172...