bitvm

Smarter Bitcoin Contracts | Bitcoin „virtual machine“


https://bitvm.org/
https://github.com/Rsync25/awesome-bitvm

STU-1 | An 8bit CPU for bitVM
https://github.com/supertestnet/8bit-cpu-for-bitvm

Supported commands

0. NOP -- do nothing
1. LDA -- load a value from ram into register A
2. ADD -- add the number in whatever byte you specify to the number currently in register A
3. SUB -- subtract the number in whatever byte you specify from the number currently in register A
4. STA -- store register A in ram
5. LDI -- load a value directly into register A (not from ram)
6. JMP -- jump to another instruction
7. JIC -- jump to another instruction if the carry bit is set, that is, if register A overflowed while computing a previous instruction (this allows for "bounded loops" so that the cpu can run a loop for X number of times and then break out of it)
8. HLT -- stop the computer (actually stops the microinstruction counter from incrementing so that the computer stops changing its state til it runs out of cycles)

9. .org -- initialize a byte of ram to a certain value (used in combination with .word)
10. .word -- the value to initialize a byte of ram to (used in combination with .org)
11. labels -- Assembly lets you name your functions using labels. An example is given in
test_program.asm. Named functions can be written once and then called one or more times throughout your program without having to write out the code multiple times.

Compiler:
https://magical-frangipane-149aba.netlify.app/compiler




test:
https://supertestnet.github.io/8bit-cpu-for-bitvm/