Technical information
Extending Program Memory Size From 64K to 2M
Converting Applications for Increased Data and Program Memory 25
Code size increased and speed decreased, however the differences are insignificant. This behavior was
expected because the instructions that use address memory of 24 bits are coded with more words compared
to the same instructions that use 16-bit memory addresses. Additionally, the instructions need extra cycles
to perform.
6.2 Extending Program Memory Size From 64K to 2M
In porting applications from the DSP56800 platform to the DSP56800E platform, one coding
recommendation is to not use the program memory space above 64K. However, here are some issues
related to this feature if the programmer needs to use it.
In the selected example the program addresses were forced to 21 bits by using the assembler switch –op21.
Also, relocation counters for program memory were initialized with addresses higher than 64K with an
ORG p: directive.
The original code, which stores routine pointers in 1-word storage locations, had to be changed. This
pointer array was transformed into a long pointer array. To be accessed with long word instructions, this
array had to be 2-words aligned and is shown in Code Example 40.
Code Example 40. Extending Storage Size For a Pointer Array
RXQ ds 25
; DSP56800 original code
RXQ dsm 2
ds 24*2
; DSP56800E ported code
Access to these pointers was achieved using word instructions in the DSP56800 original code. The
pointers must be accessed using long word instructions (the array where they are stored should be 2-word
aligned). This is presented in Code Example 41.
Code Example 41. Accessing 21-Bit Program Addresses
move #RX_dummy,a ; getting the routine pointer
move a,x:(r0)+ ; storing the routine pointer
; DSP56800 original code
move.l #RX_dummy,a ; getting the routine pointer
move.l a10,x:(r0)+ ; storing the routine pointer
; DSP56800E ported code
Another issue is the change of flow instructions. Instructions such as JMP or JSR can perform a change of
flow to an address contained in a register. This feature was not available on DSP56800 platform and it was
substituted by a technique that used the stack and RTS instruction. Basically, the address of the routine was
placed on the stack together with SR and then an RTS instruction was executed.
The Code Example 42 is extracted from rx_ctrl.asm.
Table 9. Summary of Extended Data Memory Size
Extended Data
Memory
Size (Words)
Speed
(Cycles)
Data Program
Initial version 828 316 195246
Data memory extended 832 345 199865
Increase (percentage) +0.48 +9.17 +2.36
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...