Download ADSP-2100 Family C Programming Examples Guide
Transcript
Listing 13 stack.dsp--Modified Version Of The Stack Module /* This is a modified version of the 2101_hdr.dsp file that exists in the directory $ADI_DSP\21XX\LIB. It's been modified to remove the C library call to the SPORT0 receive interrupt service routine and copied into the working directory. */ .MODULE/ABS=0 ADSP2101_Runtime_Header; .ENTRY ___lib_prog_term; .EXTERNAL .EXTERNAL ___lib_setup_everything; main_; .EXTERNAL .EXTERNAL ___lib_int2_ctrl, ___lib_sp0x_ctrl, ___lib_sp0r_ctrl; ___lib_int1_ctrl, ___lib_int0_ctrl, ___lib_tmri_ctrl; __Reset_vector: ___lib_prog_term: __Interrupt2: __Sport0_trans: CALL ___lib_setup_everything; CALL main_; /* Begin C program */ JUMP ___lib_prog_term; NOP; JUMP ___lib_int2_ctrl;NOP;NOP;NOP; JUMP ___lib_sp0x_ctrl;NOP;NOP;NOP; /* The following line has been modified for our example */ __Sport0_recv: RTI;NOP;NOP;NOP; __Interrupt1: JUMP ___lib_int1_ctrl;NOP;NOP;NOP; __Interrupt0: JUMP ___lib_int0_ctrl;NOP;NOP;NOP; __Timer_interrupt: JUMP ___lib_tmri_ctrl;NOP;NOP;NOP; .ENDMOD; Listing 14 2101_hdr.dsp Modified Runtime Header The file stack.dsp has no assembly instructions; it initialize buffers using assembly directives. We've modified this module to create a stack of 200 locations. The file 2101_hdr.dsp is a modifed runtime header that we want to use instead of the default runtime header. You must specify the modified header with the -runhdr 2101_hdr.dsp switch on the command line. We've modified our runtime header to simplify the SPORT0 receive interrupt vector. 24