Asking for help about infinite-loop program to benchmark an HP48G+ « Next Oldest | Next Newest »

 ▼ Andrés C. Rodríguez (Argentina) Posting Freak Posts: 1,193 Threads: 43 Joined: Jul 2005 04-05-2001, 10:50 AM 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 ▼ Ernie Malaga Senior Member Posts: 312 Threads: 25 Joined: Jan 1970 04-05-2001, 03:22 PM 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 Joe Panico Member Posts: 78 Threads: 6 Joined: Jan 1970 04-05-2001, 03:29 PM 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 Andrés C. Rodríguez (Argentina) Posting Freak Posts: 1,193 Threads: 43 Joined: Jul 2005 04-05-2001, 04:17 PM Thank you Ernie and Joe! Andrés C. Rodríguez (Argentina) Posting Freak Posts: 1,193 Threads: 43 Joined: Jul 2005 04-06-2001, 09:17 AM 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. ▼ Joe Panico Member Posts: 78 Threads: 6 Joined: Jan 1970 04-06-2001, 02:25 PM 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 Dia C. Tran Senior Member Posts: 515 Threads: 41 Joined: Feb 2006 04-06-2001, 05:17 PM 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.

 Possibly Related Threads... Thread Author Replies Views Last Post HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 1,713 11-11-2013, 08:28 PM Last Post: Davi Ribeiro de Oliveira WP34s integration trapped in infinite loop Bernd Grubert 25 4,494 10-17-2013, 08:50 AM Last Post: Dieter Yet another benchmark port on the wiki: Savage Pier Aiello 35 6,393 09-26-2013, 03:22 AM Last Post: Pier Aiello A brand new calculator benchmark: "middle square method seed test" Pier Aiello 25 4,815 09-13-2013, 01:58 PM Last Post: Pier Aiello New community-maintained version of "Calculators benchmark: add loop" Pier Aiello 20 4,385 09-12-2013, 02:42 AM Last Post: Pier Aiello Calculator Speed Benchmark (Add Loop) Thomas Chrapkiewicz 2 937 01-20-2013, 11:24 AM Last Post: Thomas Chrapkiewicz HP-IL: Using 82162A Printer and PIL-Box in Same Loop Les Wright 12 2,519 05-17-2012, 11:58 PM Last Post: Les Wright HP48G Series Connectivity in a USB World Les Wright 3 1,012 05-06-2012, 01:29 AM Last Post: Reth WP-34s: Speed benchmark W. Bruce Maguire II 13 2,258 04-29-2012, 12:16 AM Last Post: Gilles Carpentier HP-15C LE -- endless loop in SOLVER Gerson W. Barbosa 9 1,868 10-27-2011, 02:20 PM Last Post: Kiyoshi Akima

Forum Jump: