OpenSpin-V
Willy Ekerslyke
Posts: 29
The attached is a bit of a hack to OpenSpin so that those wishing to try out Cluso's AUGDS/S, rogloh's PUSH/POP/LOAD/STORE and my MUL/S instructions can do so without having to deal with the instruction's binary.
I have to confess that due to lack of time I've not actually run any generated code on a P1V - relying instead on inspection of the output to validate the encoding.
There's a readme in the archive and a .spin file that simply lists the new PASM instructions. Obviously this is the full OpenSpin compiler so unless I've really messed up it will handle all existing spin/PASM code too.
Ultimately this will need to become a github fork of the official OpenSpin but there seems little point at the moment while we're just experimenting.
I'll try to keep this up to date with further additions/changes the P1V instruction set but the code is there for others to chip in as well.
UPDATE v2: Added support for rogloh's PUSH POP RETX JMPX CALLX. Also added a 'lst' directive to control printing of the instruction binary.
I have to confess that due to lack of time I've not actually run any generated code on a P1V - relying instead on inspection of the output to validate the encoding.
There's a readme in the archive and a .spin file that simply lists the new PASM instructions. Obviously this is the full OpenSpin compiler so unless I've really messed up it will handle all existing spin/PASM code too.
Ultimately this will need to become a github fork of the official OpenSpin but there seems little point at the moment while we're just experimenting.
I'll try to keep this up to date with further additions/changes the P1V instruction set but the code is there for others to chip in as well.
UPDATE v2: Added support for rogloh's PUSH POP RETX JMPX CALLX. Also added a 'lst' directive to control printing of the instruction binary.
zip
426K
Comments
Cheers,
Roger.
Not sure how I missed those I'll see what I can do over the next couple of days.
to make adding new opcodes easier at user level?
Yes it's possible but not without rewriting the entire assembler part of OpenSpin. The current assembler is very much tied to the real P1 instruction set and also shares features with the Spin compiler.
Perhaps adding a macro capability would go some way to giving user-level flexibility - I'll give it some thought but make no promises
Using a CON block to define your port definitions solves part of your request. I'm currently working on a custom assembler that allows for user defined instruction coding but it's very much a
work in progress. My radical P1V experiment requires it for 10bit source & destination addressing. I need
it to tweak the booter and allow the spin interpreter to take advantage of double cog ram.
This will assist in moving the SPR's from $1F0 to $3E0 too.
Ray
I believe I've already sorted the SPR zeroing issue with the following change to cog_alu.v
In order to increase the number of available SPR's for more ports,cpunters.etc I have to move them to $3E0 to $3FF (32 rges instead of 16)
This was also necessary to allow the spin interpreter to be expanded without overlapping the SPR address space. Many more changes have been made to accommodate
the 10 bit addressing. It's a bit of departure from the "standard P1".
Cheers
Brian