Post Reply 
New submission for Saturn assembly version of Math and Trig benchmarks...
05-14-2019, 03:47 PM
Post: #10
RE: New submission for Saturn assembly version of Math and Trig benchmarks...
(05-12-2019 08:05 PM)Jonathan Busby Wrote:  Just re-worked the code and the ( hopefully ) final version is attached, which I just uploaded to hpcalc.org.

Jonathan

Well, I highly advise *against* running the attached code. It has a subtle but nasty little bug which I'm surprised didn't cause my calculator to eat itself Smile . Specifically, when juggling the hardware return stack, I made the following error :

Code:
saveTimeandInit
...

    GOSUB   +               * Push address of the next 8 nibble to the return stack
    BSS     8               * Reserve 8 nibbles of RAM to save the current TIMER2 value
+   C=RSTK                  * Get address of TIMER2 RAM save area from the return stack
...

That is, the top level of the RSTK gets a *data* address pushed to it and then when the RTN at the end of the subroutine is called, it "returns" to that address. The solution is to replace the above code with this :

Code:
    D0=(5) =IRAMBUFF
    DAT0=C WP

For some reason I became obsessed with how to juggle the registers between the RSTK, D and C, when I had two 20-bit values and one 32-bit value, without using any other registers. Well, there is an easy fix for the code that uses IRAMBUFF, as shown above. I'll include the fixed version as an attachment and upload it to hpcalc.org later today.

Jonathan

Aeternitas modo est. Longa non est, paene nil.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: New submission for Saturn assembly version of Math and Trig benchmarks... - Jonathan Busby - 05-14-2019 03:47 PM



User(s) browsing this thread: 1 Guest(s)