Post Reply 
New submission for Saturn assembly version of Math and Trig benchmarks...
05-15-2019, 02:47 PM
Post: #13
RE: New submission for Saturn assembly version of Math and Trig benchmarks...
(05-15-2019 08:20 AM)Werner Wrote:  
(05-14-2019 03:47 PM)Jonathan Busby Wrote:  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.

Well, I forgot to mention that I later *push* the value in C.A back onto the RSTK Smile It's used by the system time restore code later. The problem is that the GOSUB is called within a subroutine, which is also called via a GOSUB. I tried juggling the RSTK levels, and, although I could get them in the correct order ( ie. return address on top ), in the process I had to clobber D.W and C.W which clobbered the read TIMER2 value Smile

Quote:? No, because you get it off the stack with C=RSTK, and the RTN at the end of the subroutine will return to the previously pushed address. Unless you exhausted the 8 levels, I see no error here. But it's been a while, admittedly.
Cheers, Werner

Well, the IRAMBUFF solution is much simpler so I chose to go with that Smile It's also simpler in that the code is not self-modifying and I don't have to zero out 8-nibbles at the end of the code Smile

If you're the the Werner with whom I corresponded often back in the day on comp.sys.hp48, then long time no see Smile Otherwise, nice to meet you anyway Smile

Regards,

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-15-2019 02:47 PM



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