Arithmetic–how the stack does it, Exchanging the x– and y–registers in the stack – HP 32SII User Manual
Page 42
2–4
The Automatic Memory Stack
File name 32sii-Manual-E-0424
Printed Date : 2003/4/24 Size : 17.7 x 25.2 cm
Exchanging the X– and Y–Registers in the Stack
Another key that manipulates the stack contents is
Z
(x exchange y). This
key swaps the contents of the X– and Y–registers without affecting the rest of
the stack. Pressing
Z
twice restores the original order of the X– and
Y–register contents.
The
Z
function is used primarily for two purposes:
To view the contents of the Y–register and then return them to y (press
Z
twice).
Some functions yield two results: one in the X–register and one in the
Y–register. For example,
z
q
converts rectangular coordinates in
the X– and Y–registers into polar coordinates in the X– and Y–registers.
To swap the order of numbers in a calculation.
For example, one way to calculate 9
ч
(13
Ч
8):
Press 13
8
y
9
Z
p
The keystrokes to calculate this expression from left–to–right are:
9
13
8
y
p
Note
Always make sure that there are no more than four numbers in
the stack at any given time – the contents of the T–register (the
top register) will be lost whenever a fifth number is entered.
Arithmetic–How the Stack Does It
The contents of the stack move up and down automatically as new numbers
enter the X–register (lifting the stack) and as operators combine two
numbers in the X– and Y–registers t o produce one new number in the
X–register (dropping the stack).
Suppose the stack is filled with the numbers 1, 2, 3, and 4. See how
the stack drops and lifts its contents while calculating