dsp56800 Freescale Semiconductor, Inc, dsp56800 Datasheet - Page 57

no-image

dsp56800

Manufacturer Part Number
dsp56800
Description
16-bit Digital Signal Controllers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
It is important that interrupt service routines do not use the MOVE A,X:(SP)+ instruction when saving to
the stack. This instruction operates with saturation enabled, and may inadvertently store the value $7FFF
or $8000 onto the stack, according to the rules employed by the Data Limiter. This could have catastrophic
effects on any DSC calculation that was in progress.
3.2.6
When bit-manipulation operations on accumulator registers are performed, as is done for integer
processing, care must be taken. The bit-manipulation instructions operate as a “Read-Modify-Write”
sequence, and thus may be affected by limiting during the “Read” portion of this sequence. In order for
bit-manipulation operations to generate the expected results, limiting must be disabled. To ensure that this
is the case, the MSP (A1 portion) of an accumulator should be used as the target operand for the ANDC,
EORC, ORC, NOTC, BFCLR, BFCHG, and BFSET instructions, not the full accumulator. See
Example 3-5.
; BFSET using the A1 register
; BFSET using the A register
Since the BFTSTH, BFTSTL, BRCLR, and BRSET instructions only test the accumulator value and do
not modify it, it is recommended to do these operations on the A1 register where no limiting can occur
when integer processing is performed.
3.2.7
There are two types of instructions that are useful for converting the 36-bit contents of an accumulator to a
16-bit value, which can then be stored to memory or used for further computations. This is useful for
processing word-sized operands (16 bits), since it guarantees that an accumulator contains correct sign
extension and that the least significant 16 bits are all zeros. The two techniques are shown in Example 3-6
on page 3-14.
Freescale Semiconductor
; Saving the A Accumulator to the Stack
LEA
MOVE
MOVE
MOVE
; Restoring the A Accumulator from the Stack
MOVE
MOVE
MOVE
BFSET #$0F00,A1
BFSET #$0F00,A
Example 3-4. Correct Saving and Restoring of an Accumulator — Word Accesses
Bit-Field Operations on Integers in Accumulators
Converting from 36-Bit Accumulator to 16-Bit Portion
(SP)+
A2,X:(SP)+
A1,X:(SP)+
A0,X:(SP)
X:(SP)-,A0
X:(SP)-,A1
X:(SP)-,A2
Example 3-5. Bit Manipulation on an Accumulator
; Point to first empty location
; Save extension register
; Save MSP register
; Save LSP register
; Restore LSP register
; Restore MSP register
; Restore extension register
; Reads A1 with saturation disabled
; Sets bits 11 through 8 and stores back to A1
; Note: A2 and A0 unmodified
; Reads A1 with saturation enabled - may limit
; Sets bits 11 through 8 and stores back to A1
; A2 is sign extended and A0 is cleared
Data Arithmetic Logic Unit
Accessing the Accumulator Registers
3-13

Related parts for dsp56800