dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 236

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Bit-Manipulation Unit
; AND the value $1F with the byte in data memory
; (that is, the lower byte at word address X:$1001)
; ===> Word Pointer = $1000, byte offset = 2
; ===> 8-bit mask in lower byte of 16-bit mask
; AND the value $F8 with the byte in data memory
; (that is, the upper byte at word address X:$1001)
; ===> Word Pointer = $1000, byte offset = 3
; ===> 8-bit mask in upper byte of 16-bit mask
Similar techniques can be used for performing bit operations on bytes with other addressing modes.
7.5.3
It is possible to create bit-manipulation operations with more complex addressing modes. AGU arithmetic
can be performed to emulate the desired addressing mode, with the resulting address stored in the N
register. Then the bit-manipulation operation is performed with the X:(N) addressing mode. Example 7-8
shows code that emulates more complex addressing modes.
; BFSET #MASK,X:(Rn+xxxx) Operation — performed in two instructions
; BFCLR #MASK,X:(Rn+Rm) Operation — performed in two instructions
7.5.4
The flexible instruction set of the DSP56800E architecture allows new bit-manipulation operations to be
synthesized with the use of existing DSP56800E instructions. This section presents some of these useful
operations that are not directly supported by the DSP56800E instruction set but that can be efficiently
synthesized by the user. Table 7-1 lists operations that can be synthesized in this manner.
7-8
Using Complex Addressing Modes
Synthetic Conditional Branch and Jump Operations
Example 7-8. Bit-Manipulation Operations Using Complex Addressing Modes
ADDA
ANDC
ADDA
ANDC
ADDA
BFSET
ADDA
BFCLR
Operation
BR1CLR
BR1SET
JRCLR
JRSET
Table 7-1. Operations Synthesized Using DSP56800E Instructions
Example 7-7. Logical Operations on Bytes Using Word Pointers
#1,Rn,N
#$FF1F,X:(N)
#1,Rn,N
#$F8FF,X:(N)
#xxxx,Rn,N
#MASK,X:(N)
Rm,Rn,N
#MASK,X:(N)
DSP56800E Core Reference Manual
Jumps if all selected bits in bitfield clear
Jumps if all selected bits in bitfield set
Branches if at least 1 selected bit in bitfield is clear
Branches if at least 1 selected bit in bitfield is set
; N = Rn + (byte offset >> 1)
; Bit Operation
; (8-bit mask placed in lower byte)
; N = Rn + (byte offset >> 1)
; Bit Operation
; (8-bit mask placed in upper byte)
; N = (Rn+xxxx)
; Perform operation with synthesized address
; N = (Rn+Rm)
; Perform operation with synthesized address
Description
Freescale Semiconductor

Related parts for dsp56800e