The Museum of HP Calculators

HP Forum Archive 15

[ Return to Index | Top of Index ]

Loops on 48GX
Message #1 Posted by V Green on 25 Apr 2005, 3:47 a.m.

I'm looking for some help re loops within a program. Here's the scenario:

A few steps into a program the 48GX performs a long mathematical procedure. Several steps later I want it to perform the same procedure using new numbers by looping back through it. How do I do this?

As a simple example:

1, 2, 3, 4, 5 and 6 are stored as a, b, c, d, e and f. How do I get the program to add a,b and c, then add d,e and f using a loop?

Thanks.

      
Re: Loops on 48GX
Message #2 Posted by Raymond Del Tondo on 25 Apr 2005, 4:29 a.m.,
in response to message #1 by V Green

A simple answer would be:

Place d,e,f,a,b,c on the stack, and do the following loop:

1 2 START
+
+
NEXT

The code between the START and the NEXT statements
will be executed two times.

This is a RTFM-type, so for more details I'd suggest reading the manual;-)

Raymond

            
Re: Loops on 48GX
Message #3 Posted by V Green on 25 Apr 2005, 5:07 a.m.,
in response to message #2 by Raymond Del Tondo

Thanks Raymond. I'll try to get hold of a manual.

VG

                  
Re: Loops on 48GX
Message #4 Posted by Raymond Del Tondo on 25 Apr 2005, 5:53 a.m.,
in response to message #3 by V Green

Hi,

much valuable information, including manuals,
can be found on www.hpcalc.org

Raymond


[ Return to Index | Top of Index ]

Go back to the main exhibit hall