Contents Links Search
 

RPN Scripts

RPN Documentation

Submit Script

Conversion
   Conversions
   Convert
   Euro
   Euro_Calculator
   Soundex
Engineering
   Feet_&_Inch
   Units
   Water
Entertainment
   Master_Mind
   Sticks!
Finance
   Annuity
   Euro_Calculator
   TVM_Financial_Functions
Math
   3D_Vectors_v1.2
   Base
   Base_Conversions
   Complex_Arithmetic
   Complex_Math
   Discrete_Math
   EBBases
   Fractions
   Fractions
   Least
   Logs_&_Powers
   Misc
   Regressions
   Scientific
   Scientific_Functions
   Scientific_Programmable
   Simple_Complex_Math
   Standard_Normal_Distribution
   Trig
Misc
   Health
   Husband's_Calculator
Physics
   Angle_of_View
   Depth_of_Field
   Physics_Functions
Time
   Clock
   Julian
   Multiple_Timer
   Stop5Watch
   Stopwatch
   Timer
Utility
   Board_Foot_Calculator
   Calendar_Functions
   Checkbook_II
   MiniG
   Stack_Handling_and_Saving
   WindChill

Stack Handling and Saving
Jann Scheuer - email


summary
Manipulates stack and saves up to 21 stack items in memory

instructions
The application manipulates the rpn stack and saves an
rpn stack of up to 21 items in memory.
Dn, Up - scrolls stack items back and forth between saved stack and rpn
stack. (Items are deleted from rpn and saved stack respectively.)
Ld - puts (loads) rpn stack on top of saved stack.
Sh - puts saved stack on top of rpn stack. Items are not deleted from
saved stack. This allows you to keep a copy of a stack of up to 21 items
in memory.
R+ - rotates rpn stack.
R- - rotates rpn stack backwards.
Srt - sorts rpn stack in ascending order. (slow)
Rev - reverses order of items in rpn stack.
Gt - gets value of tos'th rpn stack item.
Pt - puts nos in tos'th rpn stack item.
Sp - swaps nos'th and tos'th stack item.
Mn - Menu:
Hs - shows heigth of rpn stack.
# - shows heigth of saved stack.
Cls - clears rpn stack.
Clm - clears saved stack.
Ran - puts tos randomized items between +nos and -nos on top of rpn
stack.

Stack indexes for Gt, Pt and Sp refer to the rpn stack before(!) function
values are put on the stack.
Some functions do not work for rpn stacks of more than 37 items.

code
RPN.1.z+1
"Stack"
"Dn: Tos to memory"
h(xv#'21'<(xv1+XvxvX@));
"Up: Memory to tos"
xv(xvx@xv1-Xv);
"Ld: Load stack into memory" {xv#'21'<(xv1+XvxvX@:B)h!(B)};
"Sh: Show memory" xv!(.)xvV{vx@v1-Vv1<(B)};
~
"R-: Rotate backwards"hk@;
"R+: Rotate"hr@;
"Srt: Sort stack"
{1Xz0Xwh1-V{_vxw1+Xw
xwg@Xxxw1+g@Xyxxxy>
(0Xzxyxw1+p@xxxw2+p@)}xz(B)};
"Rev: Reverse stack"
h2<(.)hXw2V{vr@v1+Vvxw>(B)};
~
"Gt: Get (tos)"g@;
"Pt: Put nos in (tos)"1+p@;
"Sp: Swap (tos) and (nos)" XyXzxyg@Xwxzg@Xx
xwxz1+p@xxxy1+p@;
"Mn: Misc."D'Height of stack, # saved, clear \stack, clear memory, 
random 
|Hs|#|Cls|Clm|Ran|-|'c(h:xv:hV{_vd1}:0Xv:VXwv#'39'>(#'39'V){_v#''xw%1+}:;);

top
Nth Lab
©1996 - 2001 all rights reserved
August 03, 2001
contact