Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (33 sloc) 1.18 KB
#ip 4
0: seti 123 0 3 # Check that AND is a bitwise operation
1: bani 3 456 3
2: eqri 3 72 3
3: addr 3 4 4
4: seti 0 4 # otherwise, loop forever
5: seti 0 3 # v3 = 0 # setup
# Main loop
6: bori 3 65536 2 # v2 = v3 | 65536
7: seti 1099159 3 # v3 = 1099159
8: bani 2 255 1 # v1 = v2 & 255
9: addr 3 1 3 # v3 += v1
10: bani 3 16777215 3 # v3 &= 16777215
11: muli 3 65899 3 # v3 *= 65899
12: bani 3 16777215 3 # v3 &= 16777215
13: gtir 256 2 1 # v1 = 256 > v2
14: addr 1 4 4 # ip += v1
15: addi 4 1 4 # ip += 1
16: seti 27 4 # ip = 27 (skipped)
17: seti 0 1 # v1 = 0
18: addi 1 1 5 # v5 = v1 + 1
19: muli 5 256 5 # v5 *= 256
20: gtrr 5 2 5 # v5 = v5 > v2
21: addr 5 4 4 # ip += v5
22: addi 4 1 4 # ip += 1
23: seti 25 4 # ip = 25
24: addi 1 1 1 # v1 += 1
25: seti 17 4 # ip = 17
26: setr 1 2 2 # v2 = v1
27: seti 7 4 # ip = 7
28: eqrr 3 0 1 # v1 = (v3 == v0)
29: addr 1 4 4 # ip += v1
30: seti 5 4 # ip = 5