[Coco] [Color Computer] Re: OS-9 as Replacement for DECB.

James Diffendaffer jdiffendaffer at yahoo.com
Fri Sep 2 04:34:40 EDT 2005


>> The Coco 3 uses floating point for all its math even addition. All the 
>> floating point math can be off loaded from the interpreter onto a PIC 
>> or and AVR at more efficiency to RSBASIC. Most of the routines 
>> are bogged down by this. 
>> 
>> james
>> 
>
>	Anyone know what percent of of math in ROM BASIC programs
> actually 
> needs the dynamic range of floating point math?
>
>					kevin

Actually, most ROM routines use integers in the end.  It's not like
you can have 100.75 items in an array or turn on pixel 55.005,34.222.
And most loop counters step by an integer, not a floating point value.

Every time a variable is used by one of these routines it must be
converted from float to integer.  Very time consuming!  Adding
integers to CoCo Basic would yield a huge speedup *if* you were to
define variables as integers where possible!  Even routines that do
use floats like printing require some sort of conversion.  Only
floating point math between variables wouldn't involve some sort of
conversion.

When you use a fixed value rather than a variable in your source code
such as "PSET(4,55)" the values are strings and the interpreter must
convert them to integers... or worse... to floats and then to integers
if you do something like this "PSET(X+5,55)".  That's why a partially
compiled (P Code) interpreter would be much faster.

Just look at some BASIC source code and stop and think how many times
per line that stuff takes place!!!  Add other interpreter overhead
like garbage collection, keyboard polling and what not and you end up
bringing a fast machine to a crawl.  Theres no reason a replacement
Basic couldn't run many times faster than ECB.

An external floating point chip *might* speed things up but the CPU
has to tell it what it wants it to do, then has to wait for it to do
it and then grab the result... I'm thinking there's too much overhead
to really speed things up that way.  At least not for the work involved.

A VHDL 6809 replacement with some new instructions supporting floating
point would be different.  Those are executed inline and don't require
the overhead so they would definately speed things up.






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/CFFolB/TM
--------------------------------------------------------------------~-> 

Brought to you by the 6809, the 6803 and their cousins! 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ColorComputer/

<*> To unsubscribe from this group, send an email to:
    ColorComputer-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the Coco mailing list