dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 234

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Bit-Manipulation Unit
7.4
The bit-manipulation unit is supplemented by the capabilities found within the DSP56800E’s data ALU
unit. The data ALU instructions complement the capabilities of the bit-manipulation unit. Together these
two units provide very powerful bit-manipulation capabilities for efficient control processing.
The bit-manipulation capabilities within the data ALU unit include:
In all but the last case, operations are performed directly on the registers within the data ALU unit. Refer to
Chapter 5, “Data Arithmetic Logic Unit,” for more details.
7.5
In order to use the bit-manipulation unit effectively, some considerations must be kept in mind when
writing code that uses it. The following sections describe the recommended approach to take, and a variety
of programming techniques that can be employed, when using the bit-manipulation unit.
7.5.1
There are some potential side effects to consider when performing bit-manipulation operations on AGU
registers or the accumulators:
When bit-manipulation operations (BFCHG, BFCLR, or BFSET) are performed on 24-bit AGU registers,
the upper 8 bits of the register are set to zero.
Take special care when performing a bitfield operation on one of the data ALU accumulator registers.
Saturation may occur when an accumulator is accessed by the bit-manipulation unit. See Section 5.2.7,
“Bit-Manipulation Operations on Accumulators,” on page 5-14 for more information.
7.5.2
The bit-manipulation instructions are designed to manipulate 16-bit quantities. It is possible, however, to
perform bit-manipulations on byte values by carefully selecting the 16-bit mask.
In general, the 8-bit mask to be used should be placed in the upper or lower byte of the 16-bit mask, and the
other byte in the word should be set to zero. This ensures that only bits in the appropriate byte are affected.
Note, however, that the ANDC instruction alias inverts the mask, so the byte mask should be padded with
ones instead of zeros.
Note that these operations still access and store 16-bit quantities. The mask is simply set so that only 1 byte
is operated on. This arrangement might have potentially adverse side effects when memory-mapped
peripheral registers are operated on.
7-6
16- or 32-bit bi-directional logical and arithmetic shifting.
Single-bit arithmetic and logical shifts.
Single-bit 16- and 32-bit rotate instructions.
16- or 32-bit logical operations.
Incrementing and decrementing of memory locations.
Other Bit-Manipulation Capabilities
Programming Considerations
Bit-Manipulation Operations on Registers
Bit-Manipulation Operations on Byte Values
DSP56800E Core Reference Manual
Freescale Semiconductor

Related parts for dsp56800e