Condition: jumps if PF = 0, that is when the lowest 8 bits of the last result hold an odd number of 1 bits. JPO ("parity odd") names the same instruction. Logic instructions are the usual way to set PF from a value, since MOV changes no flags.
MOV AL, "C" ; 43h = 0100 0011: three 1 bitsTEST AL, ALMOV DL, "Y" ; MOV leaves the flags aloneJNP SHOW1 ; taken: DL stays "Y"MOV DL, "N"SHOW1:MOV AH, 02h ; DOS: print the character in DLINT 21h
The textbook use is making a 7-bit character even-parity for a serial line: if the count of 1 bits is odd, set bit 7 so the total becomes even.
AND AL, 7Fh ; seven data bits; sets PFJPE DONE1 ; already evenOR AL, 80h ; add the parity bitDONE1:
Range
On the 8086 JNP exists only in the SHORT form: two bytes, opcode 7Bh and a signed 8-bit displacement counted from the end of the instruction. The target must lie within −128..+127 bytes of that point. To go farther, invert the test and hop over an unconditional JMP, which can reach the whole segment. MASM 6 makes this rewrite itself when it finds the target out of range (its default OPTION LJMP), so the listing may show two instructions where you wrote one.
JP SKIP1 ; the opposite test, a short hopJMP FARAWAY ; any distance in the segmentSKIP1:
Later CPUs
The 80386 added a near form of every conditional jump, 0Fh 8Bh followed by a 16-bit displacement (32-bit in 32-bit code), so from the 386 on JNP can reach anywhere in the segment. Code for the 8086 must stay with the short form.