Immediate Shifts - Analog Devices adsp-2100 Manual

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

Advertisement

2 Computational Units

2.4.2.3 Immediate Shifts

An immediate shift simply shifts the input bit pattern to the right
(downshift) or left (upshift) by a given number of bits. Immediate shift
instructions use the data value in the instruction itself to control the
amount and direction of the shifting operation. (See the chapter
"Instruction Set Overview" for an example of this instruction.) The data
value controlling the shift is an 8-bit signed number. The SE register is not
used or changed by an immediate shift.
The following example shows the input value downshifted relative to the
upper half of SR (SR1). This is the (HI) version of the shift:
SI=0xB6A3;
SR=LSHIFT SI BY –5 (HI);
Input:
Shift value: –5
SR:
Here is the same input value shifted in the other direction, referenced to
the lower half (LO) of SR:
SI=0xB6A3;
SR=LSHIFT SI BY 5 (LO);
Input:
Shift value: +5
SR:
2 – 30
10110110 10100011
00000101 10110101 00011 000 000000
10110110 10100011
00000000 000 10110 11010100 011 00000

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents