HP 42S manual More than one program in the memory

Page 20

1 STO 00

5 +/- STO 01

4 STO 02

Now we just press R/S (to run the program) and we get 1, and pressing it again we have 4.

6.2 More than one program in the memory.

If we want to have more than one program in the memory we can use more than one program space. To create another program space just press ▀ GTO ..

The ▀ GTO command can be used in two different situations:

i)You are not in the programming mode.

-In this case you can use ▀ GTO .. to create another empty program space, but this happens only if the current mode is not already empty.

-You can use ▀ GTO “label”. (We will see this below)

-You can also use ▀ GTO followed by “END” or “.END.” etc to move among program spaces. (In this case I must admit 33S is better because the lack of this complication)

-And after chosen a program space you can use ▀ GTO ._ _ _ _ where in the “_”'s you put the number of the line you want to go.

ii)You are in programming mode.

-In this case you cannot change the program space.

-You can use ▀ GTO ._ _ _ _ to move to a line. (This will happen and it is not programmed) -You can use ▀ GTO “label” (This will be programmed and will make the program to jump to that label)

But what is a label? A label is a name we give to a position in the program using the LBL command which is available in ▀ PGN.FCN (it means “program functions”) menu.

To create a label you must be in the programing mode (▀ PRGM) and then just press LBL and then enter a name (1 to 7 letters). If you use only one letter you are not going to have the “” and the label won't appear automatically when you press XEQ which is good for local labels.

(Just for comparison, in 33S the label is just one letter)

Example: In the programing mode ▀ PGN.FCN LBL A A A creates a label “AAA” which appears as LBL “AAA” in program. So when the program is running and it found GTO “AAA”, for example, it will jump to the line which has LBL “AAA” instructions.

(Please note we don't need to press ▀ ALPHA to access the A, B, C, etc in this case)

Example of a program

01 LBL “AA”

02 GTO “AA”

03 .END. (you don't enter this)

This program does nothing. It just run until you press EXIT. By the way, to run it you can use R/S when the calculator's “pointer” is over the program or you can use XEQ “label”. In the present case you would use XEQ “AA”.

The XEQ function calls a program (which must have a label) and runs it. You can use XEQ function both in programing mode and also out of programing mode.

Image 20
Contents An alternative HP-42S/Free42 Manual Version 2005 Index Introduction Basic Operations RPNTurn ON/OFF Setting the display contrastTraining RPN using HP-42S Menus FIX, SCI, ENG, ALL, RDX., RDXPage Modes Menu StackGetting used to some keys of the keyboard Page Abcde Fghi Jklm Nopq Rstuv Wxyz Memory Catalog menu More on the Clear menuAssign ABS to Custom menuAssign FCN ABS Where N!=N.N-1.N-2...2.1 ProbabilityPage Complex numbers in polar coordinates Complex NumbersComplex numbers in rectangular coordinates Programming Basic programming19STOP More than one program in the memory Enter X?0 and X?Y sub-menusSqrt Real program examplesLBL Prime Using the Solver Select Solve ProgramPage Numeric Integration Ba f  xdxSub-menu Cfit StatisticsEnter 6 Σ+ Second line ALLΣ, LINΣ, Σreg and ΣRG? Functions Matrices Enter Matrix NEW = BEnter NEW Enter Complex Matrix 1 Enter 3 NEWEnter 3 NEW Edit 1 Enter →→5 +/- Enter Exit STO B RCL a RCL B Matrix CrossOther Bases Flags License