Thursday, October 11, 2007

Addition to the HP-35s stack save/restore program - III

Addition to the U program when in need to restore LASTX register and push two new values on the stack:
[X, Y, Z, T | L]-> Program invoking U001 first and U070 last ->[X', Y', X, Y | L]
Where X' is new content of X stack register present in the X stack register before U079 is executed and Y' is new content of Y stack register present in Y stack register before U079 is executed.

Of interest for programs that do not take stack register input but produces a result in the X and Y stack register.

Program:
U079 4
U080 STO I
U081 RDN
U082 RCL(I)
U083 ABS
U084 RDN
UO85 XEQ U041
U086 R^
U087 R^
U088 RTN
Comments:

Terms of use.

So now we have the subroutines:
  1. XEQ U001 to save the stack and LASTX.
  2. XEQ U029 to restore the stack and LASTX given U001 has been used to save.
  3. XEQ U050 to implement operation native unary operation stack and LASTX behaviour given U001 has been used to save.
  4. XEQ U070 to push single value on the stack and preserve LASTX given U001 has been used to save.
  5. XEQ U079 to push two values on the stack and preserve LASTX given U001 has been used to save.

No comments: