IA-32 Assembly Language Reference Manual

Byte Instructions

Byte Set On Condition (setcc)

setcc 	r/m8

ConditionTrue: 1 -> r/m8

ConditionFalse: 0 -> rm/8


If the condition is met, setcc stores a one byte at the destination specified by the effective address. If the condition is not met, setcc stores a zero byte. The following table lists the setcc condition options. Similar condition options are separated by commas, followed by the flag condition.

Table 2-10 setcc Condition List

Instruction (set+cc)

Set Byte If: 

seta, setnbe

greater, not equal or less than, CF=0 & ZF=0 

setae, setnc, setnb

equal or greater, not carry, not less than, CF=0 

setb, setc, setnae

less than carry, carry = 1, not equal or greater than, CF=1 

setbe, setna

equal or less than, not greater than carry, CF=1 or ZF=1 

sete, setz

equal, zero, ZF=1 

setg, setnle

greater, ZF=0 or SF=OF. not equal or less, ZF=1 or SF [ne ] OF 

setge, setnl

equal or greater, not less, SF = OF 

setl, setnge

less, not equal or greater, SF [ne ] OF  

setle, setng

equal or less, not greater, ZF = 1 and SF [ne ] OF 

setne, setnz

not equal, not zero, ZF = 0 


not overflow, OF = 0 


not sign, SF=0 


overflow, OF = 1 

setpe, setp

parity even, parity, PF = 1 

setpo, setnp

parity odd, not parity, PF = 0 


sign, SF = 1 

set(cc) 1(%esi)

Byte Swap (bswap) [486]

bswap	reg[16|32]

Convert little/big endian to big/little endian by swapping bytes.

bswap %ebx