Orochi
Seairth
Posts: 2,474
I mentioned a while ago that I was working on an assembler for the P1V (though it also works for the P1). Well, life happened and it got shoved to the side. I finally got back to it and cleaned it up enough for others to use. If you are interested, you can find it at:
https://github.com/Seairth/Orochi
It's written in python, but it doesn't mean you need to know python to use it. Further, I tried organizing the code so that you can easily add support for new instructions, constants, etc. with no python experience at all (just copy the code pattern you see and you should generally be safe). This will hopefully make it easier for people to quickly prototype new instructions and test them out.
As noted on github, there are still some improvements that I plan to make. If anyone has any suggestions, please let me know. And, as always, you can fork it and make the changes yourself.
https://github.com/Seairth/Orochi
It's written in python, but it doesn't mean you need to know python to use it. Further, I tried organizing the code so that you can easily add support for new instructions, constants, etc. with no python experience at all (just copy the code pattern you see and you should generally be safe). This will hopefully make it easier for people to quickly prototype new instructions and test them out.
As noted on github, there are still some improvements that I plan to make. If anyone has any suggestions, please let me know. And, as always, you can fork it and make the changes yourself.
Comments
Yup, that's it. Use pasm.py to assemble and upload.py to upload/program the .bin or .eeprom that you created. The SPIN bootstrap just starts in cog 0, then immediately turns around and starts the real code in the same cog.
Also, you can save a hex version of your file if you want to look at the generated code in a text editor. This can come in handy to verify that a newly-added instruction is resulting in the right bit pattern (for instance).
Again, the focus of the code is to make it easy to modify, even for non-python programmers. Look in assembler/lang.py to see what I mean. For instance, adding new instructions are just a matter of copying an existing entry in the instructions dictionary, then tweaking the "parameters" as necessary. Note that the template basically matches Parallax's own documentation format, so it should be familiar to everyone.
Edit: Do you know this?
Kitaro - Orochi: https://www.youtube.com/watch?v=uEJsZOkA7BY
Hah. No, I hadn't. But I'm not surprised. Yamata no Orochi seems like a perfect subject for his works.
As for my little project (which is admittedly must less grand than Kitaro's work), please make sure to let me know if there are ways I can make it easier for you (or others) to modify the code without having to learn Python.
Have you played with this at all looking to have support for the P2? Getting away from PNUT and Windows dependency would be nice while we are playing with the FPGA P2s.
I just grabbed a copy from Github....but that doesn't mean much for me!
I will eventually get around to it, but not soon.