P2 Documentation TODO's
ozpropdev
Posts: 2,792
in Propeller 2
Now that the P2 silicon is being finalized I thought I would start this thread to assist in the finalizing of the documentation.
Here's a few additions discovered in my recent V32b testing.
DEBUG: BRK #/D when used in breakpoint mode. (brk #$10 'enable breakpoint on 'brk' (stops after)) e.g. Conditional execution if_z brk #BRK_code BRK gets detected and acted upon when in the pipeline, just prior to the final 2-clock execution stage. This means that the breakpoint is unconditional, though writing the 8-bit BRK value IS conditional. and You can write a cog address to $1FE and the next debug interrupt will go there, bypassing the $1F8 ROM routine?
SKIPF Instruction: Be aware when reading the "skip_call_depth" counter that the value returned includes stack CALL/RET's made within the ISR. also Only these immediate-address branches/LOC are allowed in SKIPF/EXECF/XBYTE sequences where the instruction after may be skipped: JMP #\address CALL #\address CALLA #\address CALLB #\address CALLD PA/PB/PTRA/PTRB,#\address LOC PA/PB/PTRA/PTRB,#\address
TRGINTx instructions: These instructions will trigger an interrupt even if the interrupt is configured as "OFF".
BTW
The TRGINTx can take advantage of unused iinterrupts and use them as "interrupt blocking, non stack disturning" CALL's.
Comments
Thanks for bringing up these things.
Note: Allow 2 clocks before reading pin states.
The INA/INB registers still reflect the debug return address and PC values.
My guess this is a shadow ram operation difference. Howeve replacing the above code with a alternate method works fine.
Yes, the fast block move only writes the cog RAM and doesn't pay attention to the INA/INB read status. You need to use discrete instructions for those INA/INB S and D mux's to come into play. Thanks for bringing this up.
The two examples below demonstrate this.
and
The djnf to #loop will work correctly as a relative.
One of the failure points is where the JMP #label is in cog/LUT and in an orgh $FC000 as an example, but the label is in a new DAT and ORGH, but is not out of reach for a relative JMP. Pnut compiles this in error
Another problem is JMP #\label from cog/LUT to a label within cog/LUT range. If there is an ORGH between the JMP and label, then a hub absolute address is usually used, and if the ORGH is removed, a cog/LUT absolute address is used. But I have found errors in this process.
Code outside cog/LUT range seems to work fine, even with just a #label.
But the gotcha is if you have multiple blocks of code in hub that can be loaded and run in cog/LUT because they require an ORG 0 statement, and we don't want to waste space filling it up to $400 after the last block to the hubexec code. Also it is valid to have some code that will be further up in Hub that will also be loaded into cog/LUT to run.
It's a solvable problem for the future, but it's causing a headache to get right for the final ROM. I am hoping that we've worked around it for now.
The point was to highlight the domain crossing gotcha.
Pnut generates this error otherwise.