Commit | Line | Data |
---|---|---|
6b5e4b38 AT |
1 | @ This tests the interpreters ability to push the |
2 | @ most negative number directly to the stack. | |
3 | ||
4 | @ Construct the number -(2^63) on the stack indirectly. | |
5 | SSTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTN | -((2^63)-1) | |
6 | SSSTN | PUSH 1 | |
7 | TSST | SUBTRACT | |
8 | ||
9 | @ Now push -(2^63) directly onto the stack. | |
10 | SSTTSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSN | -(2^63) | |
11 | ||
12 | @ See if the interpreter thinks -((2^63)-1) - 1 == -(2^63) | |
13 | @ Print 1 for true and 0 for false. | |
14 | TSST | SUBTRACT | |
15 | NTSTN | BRZ > 1 | |
16 | SSSSN | PUSH 0 | |
17 | TNST | PUTDIGIT | |
18 | NNN | DIE | |
19 | NSSVTN | Mark: 1 | |
20 | SSSTN | PUSH 1 | |
21 | TNST | PUTDIGIT | |
22 | NNN | DIE |