Someone made a multiplication function for the STU-1, my 8bit computer that runs on bitvm (and thus on bitcoin)! It's true, you can write bitcoin smart contracts in Assembly now instead of learning boolean logic circuits. Try it yourself here: https://github.com/supertestnet/8bit-cpu-for-bitvm
Also, notice how the program counter counts to 10 and then jumps back to 2? That's called a "JMP" command or sometimes a Loop
"But I thought bitcoin doesn't have loops!"
Well, uh, you see life, uh...finds a way
reply
It's the loops that make Turing-completeness.
reply
Yes! But like all computers it's not formally turing complete because a turing machine is a theoretical computer whose definition requires it to have infinite memory -- and no real computer has that, certainly not the STU-1
Computer designers generally try to get "close enough" by giving their computers large enough memory that no one knows how to use it all... But somehow every few years devs find ways to use it all up and so designers need to make computers with even more memory
Btw the STU-1 doesn't even try on this front, having only 16 bytes of memory. Maybe the STU-2 will have more
reply
I love assembler language. I've programmed assembler on the Z80 processor.
reply
Whoa, cool! Now make pong for bitvm! I doubt you can fit it into 16 bytes of ram, but maybe give it a try? Or help us write a better cpu
What if we emulate the Z80 processor next? 👀
reply
I haven't done this type of ASM, but 16B sounds just enough for pong. Like the gamestate can fit probably in 2B (player 4 bits, ball 4-8 bits).
reply
What if we emulate the Z80 processor next?
Then Satoshi Nakamoto will show up in your dream and want to shake your hand
reply
And I will tell him:
Dream Satoshi, I have one request: sign a message with the private key of the genesis block saying "It's true, I have been Craig Wright all along"
Imagine the ensuing chaos
reply
i think then you are going to know it's a dream and have a lucid dream haha
reply
Just to clarify, I didn't make the pong game. I haven't used assembler in years, since I started programming in C, which I use almost every day on Microchip PICs. I would like to help, but I don't have time to take on something so serious.
reply
Not me rubbing my hands together at the idea of a ruby implementation written for bitvm
reply
Impressive!
reply
You are basically a genius. Great work
reply
I didn't make the multiplication function! This guy did: https://x.com/CryptoPengFun
But thank you :) Making the CPU was a lot of fun, now I just have to make it easy to run it on bitcoin (I've done it once successfully!)
reply
very cool
reply
deleted by author
reply