07-14-2023, 03:11 PM
The HP-12C and HP-10C have the same number of very limited conditional tests. The following should allow you to simulate some of the other missing tests.
NOTE: The symbols X' and Y' denote the original values of the X and Y registers.
These values may end up swapped in the Y and X stack registers! So write your code accordingly.
You may need to first use X<>Y to restore the original values of the stack registers.
Namir
NOTE: The symbols X' and Y' denote the original values of the X and Y registers.
These values may end up swapped in the Y and X stack registers! So write your code accordingly.
You may need to first use X<>Y to restore the original values of the stack registers.
Code:
1) x=0?
SimpLe. It's built in.
2) X<=0? AND X>0?
0
X<>Y
X<=Y?
GTO Line n1 ---> X<=0
GTO Line n2 ---> X>0
3) X>=0? AND X<0?
0
X<=Y?
GTO Line n1 ---> X'>=0
GTO Line n2 ---> X'<0
4) X<=y? AND X<Y?
X<=Y? is built in.
X<>Y
X<=Y?
GTO Line n1 ---> X'>=Y'?
GTO Line n2 ---> X'<Y'?
5) X>Y? AND X=Y? AND X<Y?
X<=Y?
GTO Line n1
GTO Line n2 ---> X>Y?
Line n1: X<>Y
X<=Y?
GTO Line n3 ---> X'=Y'?
GTO Line n4 ---> X'<Y'?
6) X=0? AND X<0? AND X>0?
first filtier out X = 0
X=0?
GTO Line n1
0
X<=Y?
GTO Line n2 ---> X'>0?
GTO Line n3 ---> X'<0?
Namir