Download ADSP-218x DSP Instruction Set Reference

Transcript
Hardware Overlays and Software Issues
If the interrupt service routine also accesses alternate data memory overlay
pages, the DMOVLAY register must be saved and restored like the PMOVLAY
register. Listing 2-4 is an example of a DMOVLAY register restoration.
Listing 2-4. DMOVLAY Register Restoration
Interrupt Vector:
jump I_Handler;
handler */
rti;
rti;
rti;
/* jump to interrupt
/* unreachable instructions */
/* used as placeholders to */
/* occupy all 4 locations of the vector */
I_Handler:
/* this subroutine should reside in fixed PM
ax0 = PMOVLAY;
/* save PMOVLAY value into ax0
dm(save_PMOVLY)= ax0;/* save PMOVLAY value to DM variable
ax0 = DMOVLAY;
/* save DMOVLAY value into ax0
dm(save_DMOVLY)= ax0; /* save DMOVLAY value to DM variable
PMOVLAY = 5;
/* isr is in PM page 5
DMOVLAY = 4;
/* isr accesses DM page 4
call My_ISR;
ax0 = dm(save_DMOVLY);
/* return from isr and restore DMOVLAY
DMOVLAY = ax0;
/* restore DMOVLAY value
ax0 = dm(save_PMOVLY);
/* restore “saved” PMOVLAY from memory
PMOVLAY = ax0;
/* restore PMOVLAY value
rti;
/* return from interrupt
My_ISR:
. . .
rts;
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
/* isr code goes here */
/* return to I_Handler instead of rti */
Loop Hardware and Overlays
The loop hardware of the ADSP-218x family operates independent of the
PMOVLAY register. Once a DO UNTIL instruction has been executed, the loop
comparator compares the next address generated by the program
sequencer to the address of the last instruction of the loop. The loop compares the address value only. This comparison is performed
2-20
ADSP-218x Instruction Set Reference