# HP 48gII User Manual Page 684

Graphing calculator.

(Recall that the function SWAP is available by using „°@) S TACK @SWAP@).
Store the program back into FUNCa by using „ @FUNCa. Next, run the
program by pressing @FUNCa . Enter a value of 2 when prompted, and press
`. The result is now two tagged numbers a:2. in stack level 2, and F:11.
in stack level 1.
Note: Because we use an input string to get the input data value, the local
variable a actually stores a tagged value ( :a:2, in the example above).
Therefore, we do not need to tag it in the output. All what we need to do is
place an a before the SWAP function in the subprogram above, and the
tagged input is placed in the stack.
performing the calculation of the function, the tag of the tagged input a is
dropped automatically, and only its numerical value is used in the calculation.
To see the operation of the function FUNCa, step by step, you could use the
DBUG function as follows:
³ @FUNCa `
„°LL @) @ RUN@ @@DBG@
@SST
@
@SST
@
@SST
@
2`
@SST
@
@SST
@
@SST
@
@SST
@
@SST
@
@SST
@
@SST
@
@SST
@
@SST
@
@SST
@
@SST
@
@SST
@
It should be pointed out that, in
Copies program name to stack level 1
Starts debugger
Step-by-step debugging, result: "Enter a:"
Result: {" a:" {2 0} V}
Result: user is prompted to enter value of a
Enter a value of 2 for a. Result: " :a:2"
Result: a:2
Result: empty stack, executing →a
Result: empty stack, entering subprogram
Result: '2*a^2+3'
Result: empty stack, calculating
Result: 11.,
Result: "F"
Result: F: 11.
Result: a:2.
Result: swap levels 1 and 2
leaving subprogram "
leaving main program "
«
Page 21-35