[Coco] gcc-coco revisited
David
dbree at duo-county.com
Fri Oct 31 12:42:08 EST 2003
On Fri, Oct 31, 2003 at 11:27:20AM -0500, James Dessart wrote:
>
>
> On Fri, 31 Oct 2003 KnudsenMJ at aol.com wrote:
>
> > > The biggest problem right now is the addition of the "direct" directive
> > > to gcc. I'm sure it can be done, but it's going to take some studying
> > > (for me, if I do it) to learn how to add a directive to gcc.
> >
> > And how to make it affect the output code.
> > At least Microware C did a great job on "direct."
>
> I'm somewhat clueless on this "direct" parameter. Is it a directive to
> the compiler to tell it to use the DP register as much as possible?
Yes. Actually, it's to "force" the use of dp. The purpose is that, if
you have (preferably) small, and more frequently-used variables, then
you use the "direct" pseudo-opt, for example, "direct int var1", it will
be referenced as a direct-page variable.
The way it works, if you compile and link file1.c, file2.c, and file3.c,
then the linker first goes through the 3 files and assigns space for all
the "direct" data variables at the bottom of the data area, then goes back
and allocates space for the remainder of the variables above these. Of
course, some or all of these latter variables could also be in the direct
page, but they will always be referenced by the extended mode, because
the compiler has no way of knowing that these will be DP variables.
More information about the Coco
mailing list