Post Reply 
RPL programming questions
02-18-2014, 07:15 PM (This post was last modified: 02-18-2014 07:20 PM by peacecalc.)
Post: #6
RE: RPL programming questions
Surprising competition,

I wrote three little programs, for testing the speed of hp 50g recalling 5000 times five different storeplaces

a) global variables program "TGLO":

Code:

%%HP: T(3)A(R)F(,);
\<< 1, 'A' STO 
    2, 'B' STO 
    3, 'C' STO 
    4, 'D' STO 
    5, 'E' STO 
    TICKS 
    1, 5000, START 
             'A' RCL DROP 
             'B' RCL DROP 
             'C' RCL DROP 
             'D' RCL DROP 
             'E' RCL DROP
              NEXT 
    TICKS SWAP - 8192 / 
    { A B C D E } PURGE
\>>

this proggie create five globales from "A" to "E" and in the loop these variables are
recalled and the values are immediately afterwards deleted. It takes on the real machine: 56 sec.

b) the second proggie: "TSTK":

Code:

%%HP: T(3)A(R)F(,);
\<< 1, 2, 3, 4, 5, 
    TICKS 
    1, 5000, START 
             5, PICK DROP 
             4, PICK DROP 
             3, PICK DROP 
             2, PICK DROP 
             1, PICK DROP
           NEXT 
    TICKS SWAP - 8192 /
\>>

this proggie create five values on stacklevel one to five and in the loop these variables are recalled by PICK and immediately afterwards deleted. It takes on the real machine: 26 sec.

Okay, two times faster.

But now the surprise:

c) working with locals "TLOC":

Code:

%%HP: T(3)A(R)F(,);
\<< 1, 2, 3, 4, 5, \-> A B C D E
  \<< TICKS 
    1, 5000, START 
             'A' RCL DROP 
             'B' RCL DROP 
             'C' RCL DROP 
             'D' RCL DROP 
             'E' RCL DROP
             NEXT 
   TICKS SWAP - 8192 /
  \>>
\>>

this proggie create five local variables from "A" to "E" and in the loop these variables are recalled and immediately afterwards deleted. It takes on the real machine: 57 sec.

So one can see in examples how to test certain commands about their time consumption. But you have each command for their own and the programming have to provide comparative environments.

Greetings
peacecalc
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RPL programming questions - HP67 - 02-17-2014, 01:54 PM
RE: RPL programming questions - peacecalc - 02-17-2014, 03:10 PM
RE: RPL programming questions - Joe Horn - 02-18-2014, 01:06 PM
RE: RPL programming questions - HP67 - 02-18-2014, 01:39 PM
RE: RPL programming questions - peacecalc - 02-18-2014 07:15 PM
RE: RPL programming questions - DavidM - 02-18-2014, 11:31 PM
RE: RPL programming questions - HP67 - 02-19-2014, 09:52 AM
RE: RPL programming questions - HP67 - 02-19-2014, 02:15 PM
RE: RPL programming questions - HP67 - 02-20-2014, 03:27 PM
RE: RPL programming questions - DavidM - 02-19-2014, 05:23 PM
RE: RPL programming questions - HP67 - 02-20-2014, 03:40 PM
RE: RPL programming questions - DavidM - 02-20-2014, 04:10 PM
RE: RPL programming questions - peacecalc - 02-19-2014, 04:15 PM
RE: RPL programming questions - HP67 - 02-20-2014, 04:36 PM
RE: RPL programming questions - RMollov - 02-24-2014, 12:47 PM



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