I think you need one instruction between the REPS and the instructions you want to repeat. It does not count in the number of instructions to repeat.
As far as using INDA++ with pusha I haven't looked at that yet.
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
'
' ORGHUB Directive Question
'
' Space betwen 00E80 and part 1in object file with 00000000 (Long's NOP)
orghub $01000 'Part 1
'
DAT
org
'
' Corrected by Chip
'
SETSPA #$0 'Set SPA
REPS #16,#1 'REPS 16 times one instruction
SETINDA #PC8080 'Set INDA 'MOVED DOWN FOR correct function of REPS
PUSHA INDA++
RET
'
' End part 1
' Space betwen part 1 and part 2 filled in object file with 00000000 (Long's NOP)
'
'
' Start of part 2
'
orghub $01100 'Part 2
'
DAT
PCBYTES long 65535 'FFFF
PC8080 long 0
'
' End part 2
Yes, I will do this probably in the next week, or so. I want to make the compiler map go from $00E80 to $1FFFF, and then make a loader to transfer it all in. The assembler needs to be augmented so that hub addresses can be declared. This way, you could build the whole hub RAM image and load it.
Yes, I will do this probably in the next week, or so. I want to make the compiler map go from $00E80 to $1FFFF, and then make a loader to transfer it all in. The assembler needs to be augmented so that hub address can be declared.
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.
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.
Then it's not an immediate value, but a pointer to a cog address.
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
Then it's not an immediate value, but a pointer to a cog address.
It's the same as you would write: MOV #123,reg
You can have an immediate value only as source not as destination.
That give inconsistency in programming -- Look again in my previous posted code then instructions I post now
000011 ZC1 1 CCCC DDDDDDDDD 000011010 POPA D read [--SPA] into D, MSB into C 1
''Decrement SPA and then store CLUT[SPA] in register D (0-511).
000011 000 1 CCCC DDDDDDDDD 010101010 PUSHA D write D into [SPA++] 1 **
'Store register D (0-511) in CLUT[SPA] and then increment SPA.
000011 001 1 CCCC nnnnnnnnn 010101010 PUSHA #n write n into [SPA++] 1 **
| 'Store register n (0-511) in CLUT[SPA] and then increment SPA.
|
|
| Bit that control # Immediate value
That give inconsistency in programming -- Look again in my previous posted code then instructions I post now
000011 ZC1 1 CCCC DDDDDDDDD 000011010 POPA D read [--SPA] into D, MSB into C 1
''Decrement SPA and then store CLUT[SPA] in register “D (0-511)”.
000011 000 1 CCCC DDDDDDDDD 010101010 PUSHA D write D into [SPA++] 1 **
'Store register “D (0-511)” in CLUT[SPA] and then increment SPA.
000011 001 1 CCCC nnnnnnnnn 010101010 PUSHA #n write n into [SPA++] 1 **
| 'Store register “n (0-511)” in CLUT[SPA] and then increment SPA.
|
|
| Bit that control # Immediate value
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...
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?
1 := varB
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:
varA := varB
varA := 1
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.
You showed me that the PUSH instruction can have the i-bit 0 or 1 while for the POP instruction the i-bit is always 1.
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? :
You showed me that the PUSH instruction can have the i-bit 0 or 1 while for the POP instruction the i-bit is always 1.
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? :
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.
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++]