02-15-2020, 07:00 PM
Well, it's been a while. But this thread shall not die yet!
It is no secret that a torchrom is awful to program, and while I do not yet have the extreme time to fix that with a worthy successor, I had time to write an Assembler for this CPU.
What does it do? It takes code written in an ""Assembly-style"" language and converts it DIRECTLY into a Schematic that you can paste (-a!!!) into the CPU's ROM. This should allow anyone to quickly write and also test a program. In the meantime it also received a tiny hardware update. The control room has an indicator for when the PC is at instruction 0, and the add instruction can now also do +1 should you so desire. This, for example shortens sequential squares by one instruction.
The Assembler can be checked out, downloaded and roasted at https://github.com/Trecar/MC-CPU01-Assembler
(Includes runnable .jar and source code)
The ReadMe should explain how to write code very well, so I don't wanna repeat myself to much here. It should make it fun to write programs for it, which is what I ultimately wanted. My point still stands, anyone can write and test code on the CPU if he wants to. No need to ask me.
Lastly, take a look at a Fibonacci program (also on GitHub):
Shoutout to Discord User Hilligan for setting me up with the perfect documents and libraries to undertake this little side-project!
Happy coding!
It is no secret that a torchrom is awful to program, and while I do not yet have the extreme time to fix that with a worthy successor, I had time to write an Assembler for this CPU.
What does it do? It takes code written in an ""Assembly-style"" language and converts it DIRECTLY into a Schematic that you can paste (-a!!!) into the CPU's ROM. This should allow anyone to quickly write and also test a program. In the meantime it also received a tiny hardware update. The control room has an indicator for when the PC is at instruction 0, and the add instruction can now also do +1 should you so desire. This, for example shortens sequential squares by one instruction.
The Assembler can be checked out, downloaded and roasted at https://github.com/Trecar/MC-CPU01-Assembler
(Includes runnable .jar and source code)
The ReadMe should explain how to write code very well, so I don't wanna repeat myself to much here. It should make it fun to write programs for it, which is what I ultimately wanted. My point still stands, anyone can write and test code on the CPU if he wants to. No need to ask me.
Lastly, take a look at a Fibonacci program (also on GitHub):
Code:
LIM sr1 0d
LIM sr2 1d
SWP lr1 15d sr0
ADD lr1 lr2 sr1
SWP lr1 15d sr2
JMP 3d
XORI ls1 233d
BZR 0d ns st
Shoutout to Discord User Hilligan for setting me up with the perfect documents and libraries to undertake this little side-project!
Happy coding!