|
|
Technical Support
Support Resources
Product Information
|
RTX51: Relocating the RTX51 Interrupt Base Address
QUESTION
Is it possible to relocate RTX-51's interrupt vector base
address?
ANSWER
Yes. There are only a few steps you must take to move the
interrupt vectors.
-
Change the startup code to begin at the target reset
vector.
-
Locate the interrupt vectors at their new location using
C51.
- Specify the code area for the linker.
-
Modify the RTXSETUP.DCL to know where to put the interrupt
vector table.
- Specify the RTX interrupt vector location to the linker.
The following example assumes that you wish to relocate the
interrupt table to 0x1000 where the reset vector is at 0x1000 and
interrupts are at 0x1003, 0x100B, 0x1013, and so on.
-
To change the startup code, copy the STARTUP.A51 file from the
\C51\LIB directory to your project directory. Search for CSEG AT
0000h and change it to CSEG AT 1000h.
-
To locate the interrupt vectors, in µVision, select the C51
Compiler command from the Options menu and select the Object tab.
Change the Offset for the interrupt vectors to 0x1000. If you don't
use µVision, add IV (0x1000) to your C51 command line.
-
To specify the code area for the linker, in µVision, select the
BL51 Code Banking Linker command from the Options menu and select
the Size/Location tab. Change the Code segment location to 1000
(note that 0x and H are not required here). If you don't use
µVision, add CODE (0x1000) to your BL51 command line.
-
Modify RTXSETUP.DCL so that the interrupt base address is
0x1000. Search for ?RTX_INTBASE EQU 0 and change it to ?RTX_INTBASE
EQU 1000h.
-
In the BL51 Linker Options dialog box, select the Additional
tab and add RTXINTBASE(1000h) to the first available line. This
linker command relocates the RTX51 interrupt table to 1000h. The
address you specify must be the same as for the ?RTX_INTBASE
declaration in RTXSETUP.DCL. Note that you may abbreviate the
linker option as RI(1000h).
Rebuild your program and look at the M51 map file to make sure
your program begins at the appropriate address.
You could also create a small assembly program that redirects the
interrupt vectors to their new locate. Either way, the real interrupt
vectors must redirect the interrupt to your new interrupt vector
table.
SEE ALSO
Last Reviewed: Thursday, February 25, 2021
|
|
|