Post Reply 
New Saturn asm "add loop" benchmark for the HP48G
10-26-2023, 05:24 PM (This post was last modified: 11-04-2023 01:17 PM by Jonathan Busby.)
Post: #1
New Saturn asm "add loop" benchmark for the HP48G
--------------------------------------------------------------------------------
WARNING : The first attachment, addloop-0.01b.zip, has a bugged ISR
in addloop and corrupts system time. These problems have been
corrected in version 0.02a . If you run 0.01b, it won't crash your calc ( at
least I don't think ), but it *can* generate bogus results.
--------------------------------------------------------------------------------

Please reference this thread for a list of other implementations.

I just recently wrote a new implementation of pier4r's "add loop" benchmark for the HP48G series.

The code overrides the interrupt system, sets TIMER2 for a 60-second countdown, and then executes :

( The following further optimized add loop was provided by Werner )
Code:
        P=      5
        C=0     W
l1      C=C+1   A
        GONC    l1
        C=C+1   P
        GONC    l1

The count I get is :

4383185

Not as much of a speedup as I had thought previous to coding this benchmark.

Note that the code, just due to my laziness, *cannot* be run on an HP48GX with a merged RAM card -- this limitation can be fixed with a =MOVEDOWN to ADISP. Also, and this is very important :

**Due to the nature of how the code reconfigures IRAM, this code is only known to work on HP48G/GX/G+ version R ROM models**

Have fun! Smile

Jonathan

EDIT #1 : Corrected funky grammar-typo...

EDIT #2 : I just noticed, that due to a minor mistake in the omission of a "P= 7" instruction, my code corrupts the system time. I'll upload a fixed version tomorrow...

EDIT #3 : Version 0.02a hopefully corrects the aforementioned "P= 7" mistake and the bug(s) in the ISR... Credit goes to Werner for the improved inner add loop...

EDIT #4 : Added latest version as attachment with none, 4x and 8x inner add loop unrolling...


Attached File(s)
.zip  addloop-0.01b.zip (Size: 3.67 KB / Downloads: 7)
.zip  addloop-0.02a.zip (Size: 3.52 KB / Downloads: 5)
.zip  addloop-0.03a.zip (Size: 5.04 KB / Downloads: 4)

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
New Saturn asm "add loop" benchmark for the HP48G - Jonathan Busby - 10-26-2023 05:24 PM



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