Programming journey

SBNZ, a single instruction virtual machine for fun

[c] <- [b] - [a]
SBNZ [5] 1023 1023 4
SBNZ [0] [1] [1] 1024
SBNZ 10 1023 1023 4
SBNZ 8 9 9 1024
0 1 5
10 1023 1023 4 8 9 9 1024 0 1 5
SBNZ [5] [42] 1023 4
SBNZ [0] [1] [1] 1024
SBNZ [1] [5] [5] 4
SBNZ [1] [5] [5] 8
SBNZ [1] [5] [5] 12
SBNZ [0] [1] [1] 1024
SBNZ [0] [5] [a] 4
SBNZ [1] [a] [a] 8
SBNZ [1] [a] [a] 12
SBNZ [1] [a] [a] 16
SBNZ [0] [a] 1023 20
SBNZ [0] [1] [1] 1024
SBNZ [0] [1023] #a 4
SBNZ [0] [5] a 8
SBNZ [0] [1] [1] 1024
SBNZ [0] [1023] 6 4
SBNZ [0] [5] 99999 8
SBNZ [0] [1] [1] 1024
0: if a != 0 goto 8
4: jmp end
8: r = r — (-b)
12: a = a — 1
16: jmp 0
0:
if a != 0 goto 8
jmp end
8:
r = r * b (insert code for multiplying)
a = a — 1
jmp 0

I live by my mentor’s words: “The key to being consistently brilliant is: hard work, every day.”