Replacing missing/changed P1 instructions on P2

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?
My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
Website: www.clusos.com
Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)

Comments

  • 5 Comments sorted by Date Added Votes
  • ABSNEG is missing from P2 I think, but probably very rarely used.
  • Cluso99Cluso99 Posts: 14,257
    edited October 3 Vote Up0Vote Down
    Tubular wrote: »
    ABSNEG is missing from P2 I think, but probably very rarely used.
    Yes it is but ABS followed by NEG should work.
    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.
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • Thanks for this thread. I suspect I'll be referencing it frequently once boards start shipping.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
    CI Server: http://david.zemon.name:8111/?guest=1
  • WAITCNT instruction, for its common use of delay some clock cycles, is now called WAITX and is as simple to use as Spin's WAITCNT.

    The less common use, of metronomic interval triggering, is now as ADDCT1/2/3 and is part of the event system.

    Money is a placeholder for cooperation
  • evanhevanh Posts: 5,953
    edited October 3 Vote Up0Vote Down
    Pin pattern matching has two groups of events you can choose from:
    - 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.
    Money is a placeholder for cooperation
Sign In or Register to comment.