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
pull down to refresh
738 sats \ 2 replies \ @supertestnet OP 6 Dec 2023 freebie
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
https://static.wikia.nocookie.net/jurassicpark/images/c/c6/JP-IanMalcolm.jpg
reply
2 sats \ 1 reply \ @SpaceHodler 6 Dec 2023
It's the loops that make Turing-completeness.
reply
0 sats \ 0 replies \ @supertestnet OP 7 Dec 2023
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
462 sats \ 6 replies \ @0xbitcoiner 6 Dec 2023
I love assembler language. I've programmed assembler on the Z80 processor.
https://i.gifer.com/JEDm.gif
reply
114 sats \ 5 replies \ @supertestnet OP 6 Dec 2023
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
122 sats \ 0 replies \ @nout 6 Dec 2023
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
10 sats \ 2 replies \ @ek 7 Dec 2023
Then Satoshi Nakamoto will show up in your dream and want to shake your hand
reply
483 sats \ 1 reply \ @supertestnet OP 7 Dec 2023 freebie
And I will tell him:
Imagine the ensuing chaos
reply
10 sats \ 0 replies \ @ek 7 Dec 2023
i think then you are going to know it's a dream and have a lucid dream haha
reply
1 sat \ 0 replies \ @0xbitcoiner 6 Dec 2023
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
248 sats \ 0 replies \ @nerd2ninja 6 Dec 2023
Not me rubbing my hands together at the idea of a ruby implementation written for bitvm
reply
21 sats \ 0 replies \ @mf 7 Dec 2023
Impressive!
reply
21 sats \ 1 reply \ @elysia 7 Dec 2023
You are basically a genius. Great work
reply
0 sats \ 0 replies \ @supertestnet OP 7 Dec 2023
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
1 sat \ 0 replies \ @Ribbit 6 Dec 2023
very cool
reply
0 sats \ 0 replies \ @supertestnet OP 6 Dec 2023
deleted by author
reply