Shop OBEX P1 Docs P2 Docs Learn Events
Double check: Do NEGxx instructions set C flag from s, not from d? — Parallax Forums

Double check: Do NEGxx instructions set C flag from s, not from d?

jontyjonty Posts: 3
edited 2007-01-02 15:03 in Propeller 1
Hi,

Reading the manual for the NEGC, NEGNC, NEGNZ and NEGZ instructions I see that the C flag is set from the s-value used in the the instruction and not from the d-value as I first assumed. Is this correct?

Before I checked I thought that the Z and C flags would be set from the result of the operation, rather than from the source, as they are with most operations. But manual V1.01 for the NEGxx instructions says:
Manual V1.01 said...
If the WZ effect is specified, the Z flag is set (1) if SValue is zero. If the WC effect is specified,
the C flag is set (1) if SValue is negative or cleared (0) if SValue is positive.

Have I read this correctly?
Thanks

Jonty

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-01-02 15:03
    That is correct, it is the sign of the source value before any modifications are made.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
Sign In or Register to comment.