Using Assembly Language Interrupt Routines - Texas Instruments TMS320C2x User Manual

Optimizing c compiler digital signal processor
Hide thumbs Also See for TMS320C2x:
Table of Contents

Advertisement

6.5.3

Using Assembly Language Interrupt Routines

6.5.4
TMS320C5x Shadow Register Capability
You can handle Interrupts with assembly language code as long as you follow
the same register conventions the compiler. Keep the following points in mind:
The word pointed to by the SP (AR1) may be in use by the compiler. It must
-
be saved.
The interrupt routine must preserve the registers from Table 6−1 and
-
status bits from Table 6−2 on page 6-11 that it modifies.
If the interrupt routine calls a C function, it must preserve all registers listed
-
in Table 6−1 on page 6-10 that are not preserved by a call. Any other
register can be modified by the C routine.
Remember to precede the symbol name with an underscore. For
-
example, refer to c_int0 as _c_int0.
The TMS320C5x device automatically saves certain registers upon an inter-
rupt trap in a set of internal shadow registers. See the TMS320C5x User's
Guide for more information. If an interrupt is not nested (that is, does not reen-
able interrupts so that this interrupt routine is itself interruptible), then using the
shadow register capability is the best way to preserve those registers.
If none of the interrupts you have written in C are nested, then you can take
advantage of the shadow register capability by modifying an assembly time
flag in the source of the I$$SAVE/I$$RESTORE routines that the compiler
uses to preserve registers, as follows:
1) Unarchive the source from source library
dspar −x rts.src saverest.asm
2) Change the NEST flag in the source to 0
NEST
.set
3) Reassemble
dspa −v50 saverest.asm
4) Archive the new object file into the object library
dspar −r rts50.lib saverest.obj
0
Run-Time Environment
Interrupt Handling
6-27

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C2x and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Tms320c2xxTms320c5x

Table of Contents