[Coco] GCC: DFLOAT / DIRECT_PAGE

KnudsenMJ at aol.com KnudsenMJ at aol.com
Sat Nov 15 20:22:06 EST 2003


In a message dated 11/14/03 12:47:43 PM Eastern Standard Time, wb8tyw at qsl.net 
writes:

> 1. The compiler will treat it like a hint, just as register is a hint.
>     This means that the compiler will prefer to use direct page addressing
>     mode for the designated variable, but since it also has the absolute
>     address for the variable, or a stack/register relative address for
>     the variable, it can decide to use that instead.

Keep in mind that if a code module is assembled using DP addressing mode for 
a given var, that is an irrevocable decision that cannot be undone by the 
Linker if it finds that the variable will not fit in DP.  As someone else 
mentioned, this requires a very loud warning if it happens.

Although the DP can be moved around like a stack frame pointer, it is 
inefficient to reload it, so you don't want every little function call messing with 
it, or you will lose what you gain by using DP addressing.  

The 6809's designers actually put out a pile of philosophical hokum about how 
they did not intend the DP to be flung around as a frame pointer, that a 
program should set it once and forget it.  (These guys probably didn't use GOTOs 
or split infinitives, and spent more on Ex-Lax than on liquor).  --Mike K.



More information about the Coco mailing list