...Ну вообще выглядит интересно, но у меня пока вот #Nandgame пройден чуть менее чем наполовину...
My Nandgame CPU now has an Assembler.
Yes, it's LLM generated.
I run into the problem that I want to solve problem X, for for that, I need to solve Y, Z, Q, a.s.o first.
I needed a shortcut.
Anyway, I now can sum the numbers from 0 to 10.
I need to manually calculate jump positions. No labels.
I have no proper halt instruction and will probably simply use the nand2tetris convention of "these instruction bits need to be 1". Which is fugly for future extensions.
I have no idea how to properly solve this.
https://git.uvok.de/fpga-exper/tree/nandgame/assembler?h=main
In other news, I finished a disassembler for the nandgame CPU.
Using a "more proper" assembly syntax instead of this half-assed C-like syntax the game uses.
On the other hand,
inc <dest>, <register to increment>
looks weird.
I'm not sure how I want the final language to look lile...
https://git.uvok.de/fpga-exper/tree/nandgame/assembler/disas.py?h=main
Hm, the #nandgame instruction set seems not to use bit 11, but #nand2tetris apparently uses this bit?
I was given the impression they're the same...
I think I finished my #nandgame CPU implementation.
Now, I still need to write some testbenches....
... and then figure out whether I should write an assembler.The only one I could find was https://github.com/gmfCoding/Nandgame-Assembler.
Lo and behold! #nandgame so far: