Technical information

14 Porting and Optimizing DSP56800 Applications to DSP56800E
3.6 Operations and Memory Access on 8 Bits
Compared to its predecessor, the DSP56800E architecture introduced another new data type: 8-bit data.
There are instructions that have an 8-bit operand in memory. The 8-bit data can be accessed using two
types of pointers: word pointers and byte pointers. The Core Reference Manual contains more information
about these features.
Using this new data type reduces the amount of data memory. Byte arrays can be optimally used on
DSP56800E architecture.
An example is the function contained in tx_enc.asm. To encode 4 bits, this function uses an array
containing offsets from another table. These offsets are 2 bits wide. However, code complexity and size
would increase if these offsets had been further compacted.
The original table is defined as an array of 16 words (see Code Example 16).
Code Example 16. Array with 16-Bit Values on DSP56800
dc 2,0,3,1
dc 3,2,1,0
dc 0,1,2,3
dc 1,3,0,2
; DSP56800 original code: data memory 16 words
Using 8-bit accesses, the table can be redefined as an array of 16 bytes. Each unit of information that was
previously stored in a word is now represented as a byte (see Code Example 17).
Code Example 17. Array with 8-Bit Values on DSP56800E
dcb 0,2,1,3
dcb 2,3,0,1
dcb 1,0,3,2
dcb 3,1,2,0
; DSP56800E optimized code: data memory 8 words
The array elements are accessed using a MOVE.BP instruction, as in Code Example 18, which also
presents the instruction used in the original DSP56800 code.
Code Example 18. Accessing an 8-Bit Memory Value on DSP56800E
move x:(r1)+,y1 ; accessing a word from memory
; DSP56800 original code: 1 cycle / 1 word
move.bp x:(r1)+,y1 ; accessing a byte from memory
; done with a byte pointer which
; supports this addressing mode
; DSP56800E optimized code: 1 cycle / 1 word
There are differences between a word pointer and a byte pointer. The latter has more flexibility when used
with a larger variety of addressing modes.
This optimization method involves the modification of the data structures. It is therefore difficult to use,
but the benefits are obvious and very important in memory-constrained systems.
3.7 New Addressing Modes and New Register
Combinations in Data ALU Operations
As mentioned in Section 1, Introduction, the DSP56800E introduces some microcontroller features. One
such feature is the extension of the addressing modes in the arithmetic instructions such as ADD and SUB.
These improvements provide more flexibility than do the similar instructions on the DSP56800.
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...