Replacing missing/changed P1 instructions on P2
Cluso99
Posts: 18,069
in Propeller 2
Some P1 instructions are either different or missing on P2.
So if you are converting a P1 PASM program to P2, what do you need to know?
That's what this thread is for
REV
P1:
{label} {if_cond} REV D,[#]S {wc,wz,nr}
P2:
{label} {if_cond} REV D {wcz}
You can see from this that the number of bits to reverse [#]S is missing.
So is {nr} but that applies to all instructions.
So you can use:
{label} {if_cond} REV D
{label} {if_cond} SHR [#]S {wcz}
I've yet to prove this. Any better ways?
So if you are converting a P1 PASM program to P2, what do you need to know?
That's what this thread is for
REV
P1:
{label} {if_cond} REV D,[#]S {wc,wz,nr}
P2:
{label} {if_cond} REV D {wcz}
You can see from this that the number of bits to reverse [#]S is missing.
So is {nr} but that applies to all instructions.
So you can use:
{label} {if_cond} REV D
{label} {if_cond} SHR [#]S {wcz}
I've yet to prove this. Any better ways?
Comments
Waitcnt is different.
WaitPNE has been replaced but can't recall with what.
IIRC there are a fewcondition codes that are different too. I need to find the tricks and traps thread.
The less common use, of metronomic interval triggering, is now as ADDCT1/2/3 and is part of the event system.
- WAITSE1/2/3 events can be used for single pin events.
- The equivalent to the Prop1's WAITPNE is split into SETPAT then WAITPAT.
All WAITxxx's are zero operand instructions that just hook the event system. There is matching POLLxxx and Jxxx instructions for testing for events instead of waiting. And the interrupts hook the same event system.