Shop OBEX P1 Docs P2 Docs Learn Events
PASM: MOVD, MOVI, MOVS and the Carry flag — Parallax Forums

PASM: MOVD, MOVI, MOVS and the Carry flag

johnfosjohnfos Posts: 59
edited 2011-05-03 07:14 in Propeller 1
In the propeller manual v1.1, the descriptions of the MOVD, MOVI and MOVS instructions say in the opcode table that the carry flag is unaffected, yet the truth table says that C is affected. A note describes the instructions' effect on the Z flag, but carry is not described.

Does anyone have a definitive answer as to the carry flag behaviour?

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2011-05-03 05:15
    unsigned borrow

    And before you ask, the same is true for jmp[ret].
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-05-03 06:11
    kuroneko wrote: »
    unsigned borrow
    Yes, in SpinSim the carry bit is coded as "cflag = (unsigned int)value1 < (unsigned int)value2" for MOVD, MOVI and MOVS.
  • johnfosjohnfos Posts: 59
    edited 2011-05-03 07:14
    Wow - thanks folks, that's cleared it up.

    I'll download the SpinSim source. It's obviously a good reference.
Sign In or Register to comment.