[Coco] ccasm question

Robert Gault robert.gault at att.net
Tue Mar 10 19:04:25 EDT 2015


Hugo Dufort wrote:
> I'm using RegX as an additional accumulator, so it just carries a value, and it
> doesn't actually point to anything meaningful in memory. Instead of using the
> user stack to store additional fields I like to work with the existing registers
> as much as possible. In the actual case, RegX contains the sum WIDTH+COLORS and
> is used as a classical "selector" (compare, branch, code, branch).
>
> I don't know if it makes sense with the 6809, e.g. using 2-byte pointers to hold
> values or to count, even though the possible operations on these registers is
> limited.
>
> Hugo

OK now I see it, so you load regX with any width, add regA=any number of colors 
and get a result that's compared to a value to give you the HRES*4+CRES.
You don't need to use multiple look-up tables and regX can certainly be used as 
an accumulator. You do need four lines of code for each width-color combination 
and the overhead increases with each comparison.
In this case you probably used less memory than having three look-up tables with 
fewer routines. Generally, look-up tables require less code and are faster. This 
seems to be the exception to prove the rule. :)

But keep in mind that you may not want that 320 width with 2 colors. Make sure 
that screen setting actually works as it is not supported in the ROMs.
You may have been thinking of 256 width with 2 colors.

Robert


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com



More information about the Coco mailing list