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 Ztwice restores the original order of the X– and Y–register contents.

The Zfunction is used primarily for two purposes:

To view the contents of the Y–register and then return them to y (press

Ztwice).

Some functions yield two results: one in the X–register and one in the Y–register. For example, zqconverts 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 y9 Zp

The keystrokes to calculate this expression from left–to–rightare: 9 š13 š8 yp

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 to 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

2–4 The Automatic Memory Stack

File name 32sii-Manual-E-0424

 

Printed Date : 2003/4/24

Size : 17.7 x 25.2 cm