Shop OBEX P1 Docs P2 Docs Learn Events
How to invert the C-flag in PASM (Propeller 1) — Parallax Forums

How to invert the C-flag in PASM (Propeller 1)


Pleas help needed:
There must be a simple way of doing this, without sacrificing more than one opcode or register?!



  • You just need a register with a known value. I find it common to have a constant zero register (for WRxxxx), but it works with any constant register you already have, you just need to change between MUXC and MUXNC depending on the LSB and overall parity.

                MUXNC zero, #1 nr,wz ' invert C flag
    zero        long 0

    (I want to say there's a smarter way that I'm forgetting...)

  • Thank you Wuerfel,

    I have a constant called IncDest (value 512) that is used frequently - needles to say why... ;) It happens to have the LSB = 0. So this did the trick (your "wz" must have been a typo):

    MUXNC IncDest, #1 nr,wc

    Thanks a lot for your idea, works as charm! This is a good trick up the sleeve, should be added to the propeller 1 tricks and traps !



Sign In or Register to comment.