Propeller II programing questions to Chip
Sapieha
Posts: 2,964
Hi Chip.
Is That possible/correct?
Will be periodically updated with My most recent
Prop2_Docs.txt.pdf
Updated 2013_01_10
Is That possible/correct?
setspa #$0 'Set SPA SETINDA #MySpace 'Set INDA REPS #16,#1 'REPS 16 times one instruction pusha INDA++
Will be periodically updated with My most recent
Prop2_Docs.txt.pdf
Updated 2013_01_10
Comments
As far as using INDA++ with pusha I haven't looked at that yet.
C.W.
You bet! Just recode it as C.W. pointed out (I made the change in your code above).
Thanks
I'm sure more that questions come in this thread
I posted that in other thread -- But I think it was not so nice described -- So You maybe don't saw that.
My Question are in code -- If You have any more question on that ask Please.
It is possible to You made that extra directive in PNut
BIG Thanks.
Ps. Don't change HEX files behavior Thanks --- Good for blobs for all types of compilers.
One more addition if possible.
Directive that places last in Source file
Initial Start ---- INITSTART XXXXX
That Loader can execute at end of loading.
Hi All
Chip if it will not be to much --- Can You revise this PDF -- And maybe make suggestions What more needs in it.
Eles what errors You have found.
Thanks
Frist post updated with my most recent ---- Prop2_Docs.txt.pdf
http://forums.parallax.com/showthread.php?144683-Propeller-II-programing-questions-to-Chip&p=1151411&viewfull=1#post1151411
As complete as I can find on forum all parts.
No CNT register in Block Diagram [64 bits]
I've been working on documentation for the 64-bit hub counter today. Should be ready tomorrow.
Why PUSHA #1 compiles but POPA #1 not in PNut
Look in code
PUSH is a write operation, but POP is a read. You cannot read a value from CLUT and store it to an immediate, only into a cog register.
You can certainly write an immediate value into the CLUT.
Andy
But still immediate value cat point to any COG register
It's the same as you would write: MOV #123,reg
You can have an immediate value only as source not as destination.
If You look on machine code of both instructions
Both use only DDDDDDDDD field as pointer ---- but PUSHA use D field even as nnnnnnnnn for #Imediate mode
In case of PUSH the D field holds a source register or value.
On Prop1 we had that also with RDBYTE and WRBYTE, where WRBYTE uses the D-field for a source.
That give inconsistency in programming -- Look again in my previous posted code then instructions I post now
It gives inconsistency in programming an Assembler, but if you only are the user of an Assembler, pogrammed by someone else then the bit encoding does not really matter.
I think making an Assembler for the Prop2 is much more challenging than it was for the Prop1. And I fear I need to do that some day...
Andy
For me Logically it is 2 counterpart/inverse instructions.
And if I can write/use one in some ways --- I want me that its counterpart/inverse version have same possibility's.
Have you ever seen a Spin line like that? What should that do? You can not overwrite a literal number with the value of a variable. But you can use both on the source side:
And it's the same with PUSH and POP, one has a source argument and can use immediate and direct addressing, the otherone has a destination argument and can only use direct addressing.
I still see You don't have analysed Binary code for that 2 instructions.
An I try to explain you why this is so. It would make more sense if the i-bit is always 0, but you can not have both states.
Can you say me what you expect what each of these 2 instructions will do? :
Lets say -- I don't understand.
But # stands for direct register number.
If I can Write POPA 1 and it compiles -- In reality it stands for write/read by #1 number of COG register and in that way it is used in PUSHA
that give inconsistency in write code
(I'm not at my DE2...)
They do not both exist, I try to explain Sapieha why the # version makes no sense. You can not pop a value from the CLUT into an immediate value only into a cog register.
But I think I'm now out of ideas how to explain.
Andy
It is not any idea --- Maybe it is that I don't understand -- but for me notation of that 2 versions looks not correct.
My thinking was If I can use that in
PUSHA #n ---- write n into [SPA++] --- So now my question -- What I I PUSH in this case
Register number #n --- Else Indirect value in #n ?
Any of these work:
PUSHA #0 'push constant 0
PUSHA register 'push contents of register
PUSHA INDA++ 'push register[INDA++]