Search code examples
assemblyx86parity

Difference between JP and JPE or JNP and JPO in Assembly language


This question is about Parity Flag. I cannot figure out the difference between JP and JPE or JNP and JPO. Did it just another name for each one or it did have some differnce?


Solution

  • For a given jump instruction (size), there are just two parity flag conditions it can test. As you guessed, they each have two names:

    7B cb   JNP rel8  Jump short if not parity (PF=0).
    7A cb   JP  rel8  Jump short if parity (PF=1).
    7A cb   JPE rel8  Jump short if parity even (PF=1).
    7B cb   JPO rel8  Jump short if parity odd (PF=0).
    

    x86 Instruction Set Reference - Jcc (c9x.me)

    You can see that JNP and JPO are the same exact instruction (7B), as are JP and JPE (7A).