[an error occurred while processing this directive]
|
If your system configuration does not support allocating an initialized section such as .const/.econst to data memory, then you have to allocate the .const/.econst section to load in program memory and run in data memory. At boot time, copy the .const/.econst section from program to data memory. The following sequence shows how you can perform this task:
Modify the boot routine:
1) Extract boot.asm from the source library:
ar2000 -x rts.src boot.asm
2) Edit boot.asm and change the CONST_COPY flag to 1:
CONST_COPY .set 1
3) Assemble boot.asm:
asm2000 -v28 boot.asm
4) Archive the boot routine into the object library:
ar2000 -r rts2800.lib boot.obj
For a .const section, link with a linker command file that contains the following entries:
MEMORY
{
PAGE 0 : PROG : ...
PAGE 1 : DATA : ...
}
SECTIONS
{
...
.const : load = PROG PAGE 1, run = DATA PAGE 1
{
/* GET RUN ADDRESS */
__const_run = .;
/* MARK LOAD ADDRESS */
*(.c_mark)
/* ALLOCATE .const */
*(.const)
/* COMPUTE LENGTH */
__const_length = .- __const_run;
}
...
}
Similarly, for an .econst section, link with a linker command file that contains the following entries:
SECTIONS
{
...
.econst : load = PROG PAGE 1, run = DATA PAGE 1
{
/* GET RUN ADDRESS */
_ _econst_run = .;
/* MARK LOAD ADDRESS */
*(.ec_mark)
/* ALLOCATE .econst */
*(.econst)
/* COMPUTE LENGTH */
_ _econst_length = - ._ _econst_run;
}
...
}
In your linker command file, you can substitute the name PROG with the name of a memory area on page 0 and DATA with the name of a memory area on page 1. The rest of the command file must use the names as above. The code in boot.asm that is enabled when you change CONST_COPY to 1 depends on the linker command file using these names in this manner. To change any of the names, you must edit boot.asm and change the names in the same way.
E-mail: info@telesys.ru