P2 (2015) Assembly Instruction Set document - plus bugs section
Peter Jakacki
Posts: 10,193
Since we really only have a list of instructions without any descriptions we have to scour the myriad of P2 posts for information and then we have to filter out what is current as well. I've been adding a few bits of information to a document which has the instruction set and any other information such as memory maps etc that are necessary for writing assembly code for the P2.
Anyone can edit this P2 2015 Assembly Instruction Set document, please.
edit: here is a link for the published (view only) document version
So even just comments will help and any pearls of wisdom gleaned from the forum. Later on this can all be reformatted nice and neatly but otherwise it would be a good repository and reference.
Anyone can edit this P2 2015 Assembly Instruction Set document, please.
edit: here is a link for the published (view only) document version
So even just comments will help and any pearls of wisdom gleaned from the forum. Later on this can all be reformatted nice and neatly but otherwise it would be a good repository and reference.
Comments
https://docs.google.com/document/d/10qQn_-B7avY2ce0N1MDDdzOF1lACPNWUJkjHFyzITiY/edit
Or maybe he'll abandon that one and work on the same one we are.
Please everyone, don't be shy about contributing. There's a wealth of knowledge out there and I'm still scratching my head about some of these instructions which might only take you 5 minutes to comment on in the document. You don't have to worry about formatting or anything fancy, just pure raw information and links.
Updated the cog registers and hub addresses and the internal stack info as per my understanding.
maybe an incentive to keep all in one document.
Have you found any bugs in any of the math operators? I remember you saying something about SUBX not working correctly.
Now that Tachyon is starting to work again I will finish off that part of it and implement the inline assembler so then it will be easy to test out sections of assembly code. Then get back to confirming operation of these instruction but definitely the subx didn't like the source and dest being the same perhaps or whatever. Either way it doesn't work like P1 but of course I should check again with all the new updates, shouldn't I.
That's great that Tachyon is usable as a test bed for everything else.
I'll look into SUBX tonight.
Thank you, and thanks to the others for all their help.
I'd like to think that we have a bond, a common interest in the Propeller development, but for that to flourish we need to balance our time and energy between discussions and between doing. At the moment there is a great need for us to have better documentation so we can get to doing more with the P2 but the documentation is a big "doing" that needs to be done first. Who's "gunna" do it? Somebody else? To paraphrase a quote:
Documenting the P2 is an important job and everybody is confident that somebody will do it.
Of course, anybody can do it, but nobody does it. Somebody might get upset that nobody does it because it is a job everybody can do.
Everybody thinks that anybody can do it, but nobody realizes that everybody is busy instead discussing what to do.
Will it end up that everybody finds somebody to blame when nobody does what anybody could do?
While Chip is busy doing what he can and what we can't we are not "nobodies", we are somebody that knows something and can do something and if we all accept that and pitch in then we will achieve amazing things and everybody will benefit.
We need rising threads around here... if we can sink threads we should be able to raise them:)
INCMOD
Increment the destination and wrap after source is passed
dest = (dest+1)//(source+1)
If a modulus 10 is required then set the source to 9
edit: replaced with newer stack list to one corresponding with stack notation where the top item is the rightmost
The assembler is invoked from the serial terminal and I enter two instructions in raw format (haven't added a preprocessor yet) which is assembled and listing. I can then enter two parameters 8 and -1 which are the 2nd and 1st parameters respectively and run that code 10 times with the stack listing each time plus the initial stack.
Be aware that if the dest. value is greater than the source value, INCMOD does not rollover to zero.
Edit: See more discussion here including Chip's comments.
http://forums.parallax.com/discussion/comment/1249697/#Comment_1249697
Confirmed, but the document stands as "my observations", not as a final answer, but to gain some insight and help document the the operations. A bit like a playground in a way.
Your desire to document the P2 is very generous.
Thanks Loopy, but now I feel like I'm "flundering" with all that I've taken on! A week ago I was all set to tack on SD FAT32 and then move on to the network servers, and now look, my "desire" to document the P2 is a rod for my own back but "somebody" has got to do it.
As for Tachyon I realize now that I have made it incompatible with the DE0 as the DE0 doesn't have Cordic and the job would so much easier if PNut had some IFDEFs etc to make it easier to build different versions. But I will dig out my DE0 and make sure I get the latest version of Tachyon to run on it.
If I can get on with actually writing code rather then documenting I will have a fully self-hosting system up soon and even have VGA even if it has to be bit-bashed.
Can't you do the IFDEFs in Tachyon? Include non-CORDIC versions of everything, and then at boot test if the CORDIC works, and if it doesn't then change any words that use the CORDIC to point to the non-CORDIC versions of the functions.
While I'm at it... there is a section in the cordic documentation that is missing ... regarding rotating a point. I haven't been able to figure it out:)
Here is a pdf of the latest version.