[Coco] gcc-coco revisited

Roger Taylor rtaylor at bayou.com
Sat Nov 1 02:44:00 EST 2003


At 09:50 PM 10/31/2003 -0500, you wrote:
>In a message dated 10/31/03 12:24:31 PM Eastern Standard Time,
>dbree at duo-county.com writes:
>
> > > You can't write really efficient 6809 code without it!  Global variables
> > rule!
> >
> >  Exactly!  "Direct" is a must.  Actually, we would need this in the RSDOS
> >  version, too.
>
>Fer sure, you want it in RSDOS too.  Nobody would write RSDOS assembler by
>hand without Direct.
>
>BTW, years ago BYTE or some other mag listed some standard speed test
>programs in C.  I copied one to OS-9 C on the Coco3, in three versions:
>
>(1) All variables were local/automatic on the stack frame.  Ran pretty slow,
>as expected.
>
>(2) All vars were declared global (outside of main() ), but not Direct.  Ran
>slow, maybe even slower than (1), due to the clunky U-relative PIC addressing.
>
>(3) Like (2) but I added Direct to all globals.  Tore up the town!  Maybe 4X
>faster.


My Projector-3 program uses a global variable segment like this:
         ORG     0
var1    rmb     1
var2    rmb     1
this    rmb     2
that    rmb     2

etc...

All modules include that file during assembly.  The DP addressing is 
automatic (especially with CCASM), so there's really no reason to force an 
8-bit address mode using "<".  In fact, if these variables somehow spilled 
over past address 255, the wheels keep on spinning.  You'll just get 16-bit 
address modes for some instructions.  However, mine don't spill over.  :)






More information about the Coco mailing list