HP Forums
Asking for help about infinite-loop program to benchmark an HP48G+ - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: Asking for help about infinite-loop program to benchmark an HP48G+ (/thread-8883.html)



Asking for help about infinite-loop program to benchmark an HP48G+ - Andrés C. Rodríguez (Argentina) - 04-05-2001

I just bought a HP 48G+ just for collecting purposes. It looks almost new, but I am puzzled about the speed of this unit, most functions take more time than I expected (based on my HP41 and 42 experience). Perhaps it is right this way, I don’t know.

I would like to run a simple benchmark to see if this particular unit is OK or not. On a HP 41, I’d write a simple program (infinite loop) just as:

LBL 00

1

+

GTO 00

and see how many iterations took place during, say, one minute.

(In fact, on a HP 41 I would use automatic duplication of the T stack register, or use a ISG loop, but I am trying to keep this example very simple and clear)

I’ve found (as expected) that none of my programming experience in HP25, HP41, HP42 or HP32Sii is of any help. While I am prepared to work through the manuals to learn the HP 48 programming model, I would appreciate any shortcut right now! :-)

Could someone please let me know how to create and run a infinite loop program on a HP 48?

If someone knows, what speed (iterations per minute) should I expect?

Thank you in advance

Andres


Re: Asking for help about infinite-loop program to benchmark an HP48G+ - Ernie Malaga - 04-05-2001

Try the following for infinite loops:

WHILE 0 0 SAME REPEAT
/* Body of loop here */
END

Essentially, what's happening is that the loop will repeat for as long as 0 and 0 are the same (i.e., always).

You can use DO...UNTIL instead:

DO
/* Body of loop here */
UNTIL 1 2 SAME END

which will repeat the loop until 1=2 (i.e., will never stop).

-EM


Re: Asking for help about infinite-loop program to benchmark an HP48G+ - Joe Panico - 04-05-2001

Andres,

A good source for HP48 programs is www.hpcalc.org. Using a loop yields different results depending upon the manner a value is incremented. A basic "infinite" loop is:

DO
UNTIL 0
END

This doesn't count a value. You could add something after the DO before the UNTIL such as:

'A' INCR DROP assuming the variable A exists

or try a stack solution:

0
DO
1 +
UNTIL 0
END

Joe




Thank you !! - Andrés C. Rodríguez (Argentina) - 04-05-2001

Thank you Ernie and Joe!


Just in case: Benchmark results (infinite loop) - Andrés C. Rodríguez (Argentina) - 04-06-2001

The simplest loop program (just add 1 to the x register and loop back) was run for 1 minute. The results are the number of iterations made by each model (approx):

HP 41 C: 450

HP 42 S: 1750

HP 32 Sii: 3250

HP 48 G+: 11800

I don't have the exact numbers, I am posting this here just as an order of magnitude reference.




Even faster - Joe Panico - 04-06-2001

Andres,

Just for fun I tried the same loops in System RPL.

This one did about 30,000 in one minute:

 System RPL code
%0 real number 0
BEGIN begin loop
%1+ add real number 1 to item on stack
ATTN? check if ON key is pressed
UNTIL end of loop structure


While this did about 50,000:

ZERO       binary integer zero
BEGIN
#1+ add binary integer 1 to item on stack
ATTN?
UNTIL

I'm sure someone knowing assembly can acheive even greater performance.

Joe


Re: The 48 is fast compare to older calculators but... - Dia C. Tran - 04-06-2001

As you found out that the 48 would run programs much faster than the 41 or 42. However, you did mentioned that it seemed slow for most functions. I think the 48 is slower in manual calculation because it often has to do its garbage cleaning on its very large stack.