OK, I know this is probably a basic question with a basic answer, but I have read the manual for the 21065l, and Visual DSP, without finding the answer. If someone could give me a pointer I would be grateful. My question is how to define the code for interrupts in assembly. I want to set the program up so that receiving a word at SPORT0 calls an interrupt routine to do the processing. The only problem is I can't find in the manuals (and I know it must be there somewhere) how to define for the assembler (or the linker) exactly which code is the interrupt routine that is called by the SPORT0 receive interrupt. Please help me out someone. ===== Peter (Brisbane, OZ) Zone 11 www.geocities.com/petersemple |
|
21065l interrupts
Started by ●November 11, 2002
Reply by ●November 11, 20022002-11-11
--On Sunday, November 10, 2002 10:45 PM -0800 Peter Semple <> wrote: > My question is how to define the code for > interrupts in assembly. I want to set the program up > so that receiving a word at SPORT0 calls an interrupt > routine to do the processing. The only problem is I > can't find in the manuals (and I know it must be there > somewhere) how to define for the assembler (or the > linker) exactly which code is the interrupt routine > that is called by the SPORT0 receive interrupt. > Please help me out someone. If your program is written entirely in assembler, you install the ISR in a 4-instruction entry in a table between 0x8000 and 0x8100. Each interrupt is given 4 instructions to get its ISR done in. You can jump out of this table if your ISR takes more than 4 instructions. See any of the boot loader sources to see which offset goes with which interrupt. If your program is written in C and uses the C runtime header, then this table is already populated with jumps to a "dispatcher" defined in the C library. The dispatcher saves registers and then looks up a C handler in another table (internal to the C library) and runs it. You use the C interrupt() API to install a C routine in this second table. But you can also use a handler written in assembler, as long as it follows C register conventions. You could also copy the C runtime header source and modify it to selectively install asm handlers in the first table, and compile that into your code. Finally, you can use the PX register to selectively "poke" your asm code into the first table. |