Do you have a question? Post it now! No Registration Necessary
- Randy Yates
August 24, 2013, 4:06 pm

I'm using the cosmic c tools version 4.4.22 (for the Freescale 9S12 MCU)
and would like to be able to link MY OWN libraries to banked segments.
I am thinking that if I compile the code that goes into the libraries
with the +modf option, all functions will then be "far" and I can locate
them in banked segments.
However, I am not sure what technique to use in the linker command file
(.lkf file) to place libraries in specific banks. For example, will this
work:
# PIX = 38
+seg .ftext -b 0xe0000 -o 0x08000 -m 0x4000 -w 0x4000 -n Page0 -s CODE # Page 0 of banked code PPAGE=0x38
mylib.a
if I just want to put the whole library in one segment? Do I have the
option of locating the individual functions in the library to different
segments? If so, what's the syntax?
# PIX = 38
+seg .ftext -b 0xe0000 -o 0x08000 -m 0x4000 -w 0x4000 -n Page0 -s CODE # Page 0 of banked code PPAGE=0x38
mylib.a:myfunction1
# PIX = 30
+seg .ftext -b 0xe4000 -o 0x08400 -m 0x4000 -w 0x4000 -n Page1 -s CODE # Page 1 of banked code PPAGE=0x39
mylib.a:myfunction2
or somesuch?
and would like to be able to link MY OWN libraries to banked segments.
I am thinking that if I compile the code that goes into the libraries
with the +modf option, all functions will then be "far" and I can locate
them in banked segments.
However, I am not sure what technique to use in the linker command file
(.lkf file) to place libraries in specific banks. For example, will this
work:
# PIX = 38
+seg .ftext -b 0xe0000 -o 0x08000 -m 0x4000 -w 0x4000 -n Page0 -s CODE # Page 0 of banked code PPAGE=0x38
mylib.a
if I just want to put the whole library in one segment? Do I have the
option of locating the individual functions in the library to different
segments? If so, what's the syntax?
# PIX = 38
+seg .ftext -b 0xe0000 -o 0x08000 -m 0x4000 -w 0x4000 -n Page0 -s CODE # Page 0 of banked code PPAGE=0x38
mylib.a:myfunction1
# PIX = 30
+seg .ftext -b 0xe4000 -o 0x08400 -m 0x4000 -w 0x4000 -n Page1 -s CODE # Page 1 of banked code PPAGE=0x39
mylib.a:myfunction2
or somesuch?
--
Randy Yates
Digital Signal Labs
Randy Yates
Digital Signal Labs
We've slightly trimmed the long signature. Click to see the full one.
Site Timeline
- » stm8 development board with at least 4KB of RAM?
- — Next thread in » Embedded Programming
-
- » What's the maximum RAM size that can be embedded in an ASIC today?
- — Previous thread in » Embedded Programming
-
- » Static allocation and data hiding
- — Newest thread in » Embedded Programming
-
- » carica cellulare per auto... quale ?
- — The site's Newest Thread. Posted in » Electronics Hobby (Italian)
-
- » Caricatore rapido batterie, chiarimento.
- — The site's Last Updated Thread. Posted in » Electronics Hobby (Italian)
-