[Coco] GCC - Direct page and Double Float - Potential solution.

jdaggett at gate.net jdaggett at gate.net
Tue Nov 18 23:32:11 EST 2003


On 18 Nov 2003 at 21:52, John E. Malmberg wrote:

> KnudsenMJ at aol.com wrote:
> > In a message dated 11/18/03 8:04:40 AM Eastern Standard Time,
> > wb8tyw at qsl.net writes:
> > 
> >>I need to find out what direct page locations that 
> >> BASIC does not care about if they get trashed
> > 
> > I don't have a list handy, but this was common knowledge back in the
> > glory days -- lists of "safe" data locations were published in the
> > Rainbow, passed around on bull boards, etc.  The "Unravelled" books
> > probably list them.  Make sure you allow for Extended and Disk and
> > Super-Extended (Coco3).
> 
> CB - DA, - Scratch
> F3 - FF  - Unused
> 
> Now does anything else that would be resident with a C program, like
> an addon disk controller or DOS extender use these?
> 
> > BTW, ISTR that there is no advantage to putting arrays or strings in
> > DP.
> 
> Arrays accessed sequentially are through index registers with auto
> increment/decrement, so they are slightly faster than a DP access.
> Random access in an array would be about the same as DP, assuming that
> you were able to keep the array index in a register.
> 

Array processing is best left to the pointer registers and the stack. Unless you have 
a small array of say ten bytes or so, then maybe placing the array in the DP area of 
ram is not a bad idea. Then the DP becomes a pointer and the post byte after a 
Direct instruction will be the offset into the array. 

If you plan to place the array outside of DP ram and use the DP register to point to 
it, you limit the array to be on 256 byte boundaries and a max of 256 bytes. Then 
before and after each call into the array the DP has to be modified. This will have to 
be done with stack push and pulls or exchange of the DP and ACCx register. Not 
sure if code size and speed are gained by doing that.   

With three usable pointer registers (X,Y,U) and the stack, I am not so sure one 
really needs to the use the DP register to point to arrays. How many programs will  
need to access four arrays at one time? 
 
james

> 
> Looking at the 68CH11, it looks like I can also set up targets for
> COCO2ROM, COCO3ROM, OS9, OS9II, FLEX09, and STANDALONE.  Of these,
> only COCO2ROM and COCO3ROM would need the "SOFT" register range
> restricted.
> 
> It does look like GCC will only use 31 registers, or for a COCO, 62
> bytes.
> 
> -John
> wb8tyw at qsl.net
> Personal Opinion Only
> 
> 
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco





More information about the Coco mailing list