Life.
Both S.O.S and hospital this time screw up things So I'm not so good it need be before them send me home
And hospital non't fix what them need
life --- If people don't talk to others -- Only make assumptions. And at least don't listen to me that them made problems instead of made me better
I'm in the middle of adding P2 instructions to the GNU assembler and I've gotten to the handling of INDA and INDB and their addressing modes. Can I assume that the special INDA and INDB modes can be used in any instruction that has a SSSSSSSSS and/or DDDDDDDDD field and also has a CCCC field?
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.
But my question to Chip are on Building BIG objects files that PNut have ORGHUB to control of placement of binary parts in HUB.
When I ported pfth to the P2 I handled the hub addressing using this hack:
dat
byte 0[$0e80]
This caused all of my code to be loaded starting at $0e80 rather than hub address zero. I then added a -s option to p2load to skip over the first $0e80 bytes before starting to load. This allows me to assemble code with the correct hub addresses up to 32k bytes on the DE0-Nano or the full 128k bytes on the DE2-115.
When I ported pfth to the P2 I handled the hub addressing using this hack:
dat
byte 0[$0e80]
This caused all of my code to be loaded starting at $0e80 rather than hub address zero. I then added a -s option to p2load to skip over the first $0e80 bytes before starting to load. This allows me to assemble code with the correct hub addresses up to 32k bytes on the DE0-Nano or the full 128k bytes on the DE2-115.
BUT why I need that --- If correct written --- PNut can handle that for me.
Why I need use manually patches --- If Computers are so more usable to TRIM that with simple directives.
Just a suggestion to help you make progress while you wait for an update to PNut.exe. If I had waited for HUBORG I would have lost weeks of development time.
Just a suggestion to help you make progress while you wait for an update to PNut.exe. If I had waited for HUBORG I would have lost weeks of development time.
pnut.exe is only a temporary program until a fully open P2 compiler is complete. Therefore we have to work around some deficencies. Otherwise we will have all the tools and no P2 to run them on.
But with PNut we made standards -- We need live with after that.
For me PNut can be only compiler that we have If it can compile to usable OBJECT files.
What type of Tools Parallax made for P2 -- It still need some functions to simplify programming.
Else it will be that we have now on P1 --- No any possibility to control in Tools. For advanced programming I need compile every BLOB separate and then make my own object file.
I think it is not correct way ---- Not acceptable for Industry to.
pnut.exe is only a temporary program until a fully open P2 compiler is complete. Therefore we have to work around some deficencies. Otherwise we will have all the tools and no P2 to run them on.
I'm still uncertain as to how the REPD instruction is handled in the assembler. I know Chip said that a repeat count of 7 will do the loop 8 times. At one point PNut.exe would subtract one from immediate values before encoding them into the instruction so that #8 would repeat 8 times not 9. Is that still the case? I think it would be better if #7 actually encoded 7 into the instruction so that the behavior of immediates matches that of register arguments where no automatic "subtract one" is possible. Was this changed or does PNut.exe still encode 7 for an argument of #8?
I'm still uncertain as to how the REPD instruction is handled in the assembler. I know Chip said that a repeat count of 7 will do the loop 8 times. At one point PNut.exe would subtract one from immediate values before encoding them into the instruction so that #8 would repeat 8 times not 9. Is that still the case? I think it would be better if #7 actually encoded 7 into the instruction so that the behavior of immediates matches that of register arguments where no automatic "subtract one" is possible. Was this changed or does PNut.exe still encode 7 for an argument of #8?
Clarity of source code should always win, so a line that reads #8 but actually did 9 loops in HW, is not a good idea.
If the opcode has different modes, then it is better to split to two opcodes, to keep clarity.
The binary output is the same in all cases.
eg REPDi #N ; Immediate param Tells silicon to repeat N times. ie What you wrote is exactly what happens
and
REPDvRp1 RegName ; Silicon repeats (Value in Register)+1 times - hence the vRp1 opcode name and hint.
Clarity of source code should always win, so a line that reads #8 but actually did 9 loops in HW, is not a good idea.
I think the idea is that the REPD instruction takes effect at the end of the loop to decide if the loop should be repeated. So, REPD #1 would repeat the loop once after executing it the first time and REPD #0 would not repeat it at all but would still execute it the first time. It's a little obscure though I admit.
This looks like a good place where some ASM smarts are needed.
Users should not have to opcode count.in 2012+
REPSb #20_000 ' execute block of (here 4) instructions 20,000 times
' NOP '1 spacer instruction needed - REPSb / REPDb auto-inserts spacer(s) as needed, if not included
:_RepeatStart
NOTP #0 'toggle P0
NOTP #1 'toggle P1
NOTP #2 'toggle P2
NOTP #3 'toggle P3, block repeats every 4 clocks
:_RepeatEnd
Here the REPSb opcode, is just a little smarter, it does the following housekeeping
* checks :_RepeatStart is == +1 spacer, and if not, adds one NOP, warns if > 1 (use 3 for REPDb)
* uses reserved forward local labels :_RepeatStart :_RepeatEnd to define the block size
I think REPx cannot be nested, so labels have a simple lifetime until next REPx
A macro assembler could probably manage via this ?
REPSb #20_000,_RepeatStart,_RepeatEnd
Honestly the instruction makes perfect sense to me. Repeat means it has happened once, or it would not be repeated. Executing x number of times is a different thing.
Honestly the instruction makes perfect sense to me. Repeat means it has happened once, or it would not be repeated. Executing x number of times is a different thing.
Either interpretation of the count is okay with me. I just don't like that the register form would work differently than the immediate form.
I'm still uncertain as to how the REPD instruction is handled in the assembler. I know Chip said that a repeat count of 7 will do the loop 8 times. At one point PNut.exe would subtract one from immediate values before encoding them into the instruction so that #8 would repeat 8 times not 9. Is that still the case? I think it would be better if #7 actually encoded 7 into the instruction so that the behavior of immediates matches that of register arguments where no automatic "subtract one" is possible. Was this changed or does PNut.exe still encode 7 for an argument of #8?
Yes this is still the case. I've tested both instructions:
REPS #3,#n executes the repeat block 3 times, while
REPD tmp,#n executes the block 4 times if tmp initialized with 3.
REPS and REPD are just different instructions witth a different behavior. It's more important to make REPS easy to use than to make it similar to REPD.
@jmg
You already can do this:
REPS #16_000,@:end ' execute block from here+2 to :end 16,000 times
NOP
NOTP #0 'toggle P0
NOTP #1 'toggle P1
NOTP #2 'toggle P2
:end NOTP #3 'toggle P3, block repeats every 4 clocks
Yes this is still the case. I've tested both instructions:
REPS #3,#n executes the repeat block 3 times, while
REPD tmp,#n executes the block 4 times if tmp initialized with 3.
REPS and REPD are just different instructions witth a different behavior. It's more important to make REPS easy to use than to make it similar to REPD.
@jmg
You already can do this:
REPS #16_000,@:end ' execute block from here+2 to :end 16,000 times
NOP
NOTP #0 'toggle P0
NOTP #1 'toggle P1
NOTP #2 'toggle P2
:end NOTP #3 'toggle P3, block repeats every 4 clocks
Andy
Yes but REPD also has an immediate form and I think it probably works the same as REPS where #8 means to execute the code 8 times. That means the following two sequences do different things.
REPD #8, ...
and
MOV r1, #8
REPD r1, ...
It seems to me that these two forms should behave the same way.
Yes you are right, I was not aware of the immediate form of REPD.
But why use REPD for an immediate number of repeats, it has only disadvantages: More slots between the REP and the code, only 512 repeats possible.
I see it so: With an immediate value the Assembler can help to calculate the right value. With a register for the repeat count the Assembler has no chance and it's up to the programmer to do it right.
Yes you are right, I was not aware of the immediate form of REPD.
But why use REPD for an immediate number of repeats, it has only disadvantages: More slots between the REP and the code, only 512 repeats possible.
I see it so: With an immediate value the Assembler can help to calculate the right value. With a register for the repeat count the Assembler has no chance and it's up to the programmer to do it right.
Andy
I guess you can make that argument but it means that this instruction will work differently than every other instruction with a choice between an immediate value and a register value. I think the main way to make an instruction set easy to learn is to have it behave consistently in all cases, not have special cases where they are not necessary. Anyway, I guess it's up to Chip and it seems he's already made the decision to subtract one from the immediate values before encoding them.
Comments
Life.
Both S.O.S and hospital this time screw up things So I'm not so good it need be before them send me home
And hospital non't fix what them need
life --- If people don't talk to others -- Only make assumptions. And at least don't listen to me that them made problems instead of made me better
I know this is the worst time of year for you.
What happens on that part.
As You can see from this link WE need it.
http://forums.parallax.com/showthread.php?144384-p2load-A-Loader-for-the-Propeller-II&p=1153948&viewfull=1#post1153948
I respect Yours work on p2load.
But my question to Chip are on Building BIG objects files that PNut have ORGHUB to control of placement of binary parts in HUB.
This caused all of my code to be loaded starting at $0e80 rather than hub address zero. I then added a -s option to p2load to skip over the first $0e80 bytes before starting to load. This allows me to assemble code with the correct hub addresses up to 32k bytes on the DE0-Nano or the full 128k bytes on the DE2-115.
I can all side ways.
BUT why I need that --- If correct written --- PNut can handle that for me.
Why I need use manually patches --- If Computers are so more usable to TRIM that with simple directives.
Thanks.
BUT think that I program in assembler on different CPU's from 1976 ---- Do You think I still don't ?
Do not forget the language boundary that is crossed here... that can make comments seem more terse than meant.
You are correct.
But with PNut we made standards -- We need live with after that.
For me PNut can be only compiler that we have If it can compile to usable OBJECT files.
What type of Tools Parallax made for P2 -- It still need some functions to simplify programming.
Else it will be that we have now on P1 --- No any possibility to control in Tools. For advanced programming I need compile every BLOB separate and then make my own object file.
I think it is not correct way ---- Not acceptable for Industry to.
Clarity of source code should always win, so a line that reads #8 but actually did 9 loops in HW, is not a good idea.
If the opcode has different modes, then it is better to split to two opcodes, to keep clarity.
The binary output is the same in all cases.
eg REPDi #N ; Immediate param Tells silicon to repeat N times. ie What you wrote is exactly what happens
and
REPDvRp1 RegName ; Silicon repeats (Value in Register)+1 times - hence the vRp1 opcode name and hint.
Users should not have to opcode count.in 2012+
Here the REPSb opcode, is just a little smarter, it does the following housekeeping
* checks :_RepeatStart is == +1 spacer, and if not, adds one NOP, warns if > 1 (use 3 for REPDb)
* uses reserved forward local labels :_RepeatStart :_RepeatEnd to define the block size
I think REPx cannot be nested, so labels have a simple lifetime until next REPx
A macro assembler could probably manage via this ?
REPSb #20_000,_RepeatStart,_RepeatEnd
Yes this is still the case. I've tested both instructions:
REPS #3,#n executes the repeat block 3 times, while
REPD tmp,#n executes the block 4 times if tmp initialized with 3.
REPS and REPD are just different instructions witth a different behavior. It's more important to make REPS easy to use than to make it similar to REPD.
@jmg
You already can do this:
Andy
But why use REPD for an immediate number of repeats, it has only disadvantages: More slots between the REP and the code, only 512 repeats possible.
I see it so: With an immediate value the Assembler can help to calculate the right value. With a register for the repeat count the Assembler has no chance and it's up to the programmer to do it right.
Andy
That is close, but if you forget NOP, or have too many, does it warn or simply swallow ?
Yes, but for GAS it's your decision.