Added tests for `not` subroutine in stdlib.
[vvhitespace] / stdlib_tests / 3001_not.pvvs
CommitLineData
24e4f91b
AT
1@ All zeros to all ones
2SSSSN | PUSH 0
3NSTTSTSSSN | JSR > 101000 (not)
4NSTTSSTN | JSR > 1001 (print number from stack)
5
6@ All ones to all zeros
7SSTTN | PUSH -1
8NSTTSTSSSN | JSR > 101000 (not)
9NSTTSSTN | JSR > 1001 (print number from stack)
10
11@ Test alternating bits, leading zero.
12@ Note that 6148914691236517205 = 0101...0101
13SSSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTN | PUSH +6148914691236517205
14NSTTSTSSSN | JSR > 101000 (not)
15NSTTSSTN | JSR > 1001 (print number from stack)
16
17@ Test alternating bits, leading one.
18@ Note that -6148914691236517206 = 1010...1010 in twos-complement but we
19@ enter it in sign magnitude format so the bit pattern appears different.
20SSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTTSN | PUSH -6148914691236517206
21NSTTSTSSSN | JSR > 101000 (not)
22NSTTSSTN | JSR > 1001 (print number from stack)
23
24@ All done.
25NNN | DIE
26
27#include <logic.pvvs>
28#include <stdio.pvvs>