From: Hugh Hartwig <hhart...@be...> - 2009-01-26 16:43
 
>So there is a way to compile and link up to 64K. When I compile for the
>2618 it fails to link above 45K (3K for boot code) because of the location
>of .vectors. The linker file defines .fartext, but it doesn't seem to take
>advantage of this additional code space. Is there an attribute flag that
>will specify the location of code to this .fartext region?

The linker doesn't support sections with holes. Since the vectors are at 
0x0ff80, the .text section can only extend to 
0x0ff7f. Unfortunately the compiler automatically places everything into the 
.text section.

you could place a function into the (for the linker defined) .fartext section 
by using the __attribute__((section
(".fartext"))).
But calling these functions requires a CALLA command instead of the normal CALL 
as well as a special return 
command (polling a 32 bit instead of a 16 bit return address from stack). The 
compiler won't generate them, so the 
code cannot be executed in the .fartext section.

Without compiler support for the 430X command set, the .fartext section can 
only be used for data. And accessing 
the data must be done by a self-written assembly function using the 430X 
commands for 20 bit access.
Also, since the compiler does not know about .fartext except that it is a 
separate section of arbitrary location, it will 
issue a section attribute error when you try to place code AND data into it by 
using the __attribute__((section
(".fartext"))).

Anyway, if you have a big precalculated table (like a sinus table), you can 
place it in .fartext and access it with your 
own assembly code, freeing up a lot of the normal 64k area.
Better than nothing.

A good opportunity for designated math library or a printf_F function for 
format text constants placed in .fartext

JMGross


Reply via email to