SETcc           Set Byte on Condition                Flags: Not altered

SETcc destination CPU: 386+

Logic if condition
destination ← 1
else
destination ← 0
endif

The SET instructions set the 8-bit destination to 1 if the
specified condition is true, otherwise destination is set to 0.

The conditions for each instruction are given below. The terms
"above" and "below" are used for un-signed integers, "less" and
"greater" for signed integers.
Note that several mnemonics have the same meaning.


Instruction SET to 1 if ... else to 0 Flags
SETA, SETNBE Above, Not Below or Equal CF=0 AND ZF=0
SETAE,SETNB,SETNC Above or Equal, Not Below, No Carry CF=0
SETBE, SETNA Below or Equal, Not Above CF=1 OR ZF=1
SETB, SETC,SETNAE Below, Carry, Not Above or Equal CF=1
SETE, SETZ Equal, Zero ZF=1
SETNE, SETNZ Not Equal, Not Zero ZF=0
SETP, SETPE Parity, Parity Even PF=1
SETNP, SETPO No Parity, Parity Odd PF=0

SETG, SETNLE Greater, Not Less or Equal SF=OF AND ZF=0
SETGE, SETNL Greater or Equal, Not Less SF=OF
SETLE, SETNG Less or Equal, Not Greater SF<>OF OR ZF=1
SETL, SETNGE Less, Not Greater or Equal SF<>OF
SETO Overflow OF=1
SETNO No Overflow OF=0
SETS Sign (negative) SF=1
SETNS No Sign (positive) SF=0


Opcode Format ; All 386+
0F 90 cb SETO r/m8
0F 91 cb SETNO r/m8
0F 92 cb SETB r/m8
0F 93 cb SETAE r/m8
0F 94 cb SETE r/m8
0F 95 cb SETNE r/m8
0F 96 cb SETBE r/m8
0F 97 cb SETA r/m8
0F 98 cb SETS r/m8
0F 99 cb SETNS r/m8
0F 9A cb SETP r/m8
0F 9B cb SETNP r/m8
0F 9C cb SETL r/m8
0F 9D cb SETGE r/m8
0F 9E cb SETLE r/m8
0F 9F cb SETG r/m8


Length and timing
Operands Bytes 8088 186 286 386 486 Pentium
r8 3 4 4/3 1/2 NP
mem8 3+d(0-2) 5 3/4 1/2 NP

Cycles are for: true/false