x86 Assembly Language Reference Manual

Bit and Byte Instructions

The bit instructions test and modify individual bits in operands. The byte instructions set the value of a byte operand to indicate the status of flags in the %eflags register.

Table 3–6 Bit and Byte Instructions

Solaris Mnemonic 

Intel/AMD Mnemonic 

Description 

Notes 

bsf{wlq}

BSF

bit scan forward 

bsfq valid only under -xarch=amd64

bsr{wlq}

BSR

bit scan reverse 

bsrq valid only under -xarch=amd64

bt{wlq}

BT

bit test 

btq valid only under -xarch=amd64

btc{wlq}

BTC

bit test and complement 

btcq valid only under -xarch=amd64

btr{wlq}

BTR

bit test and reset 

btrq valid only under -xarch=amd64

bts{wlq}

BTS

bit test and set 

btsq valid only under -xarch=amd64

seta

SETA

set byte if above 

 

setae

SETAE

set byte if above or equal 

 

setb

SETB

set byte if below 

 

setbe

SETBE

set byte if below or equal 

 

setc

SETC

set byte if carry 

 

sete

SETE

set byte if equal 

 

setg

SETG

set byte if greater 

 

setge

SETGE

set byte if greater or equal 

 

setl

SETL

set byte if less 

 

setle

SETLE

set byte if less or equal 

 

setna

SETNA

set byte if not above 

 

setnae

SETNAE

set byte if not above or equal 

 

setnb

SETNB

set byte if not below 

 

setnbe

SETNBE

set byte if not below or equal 

 

setnc

SETNC

set byte if not carry 

 

setne

SETNE

set byte if not equal 

 

setng

SETNG

set byte if not greater 

 

setnge

SETNGE

set byte if not greater or equal 

 

setnl

SETNL

set byte if not less 

 

setnle

SETNLE

set byte if not less or equal 

 

setno

SETNO

set byte if not overflow 

 

setnp

SETNP

set byte if not parity 

 

setns

SETNS

set byte if not sign (non-negative) 

 

setnz

SETNZ

set byte if not zero 

 

seto

SETO

set byte if overflow 

 

setp

SETP

set byte if parity 

 

setpe

SETPE

set byte if parity even 

 

setpo

SETPO

set byte if parity odd 

 

sets

SETS

set byte if sign (negative) 

 

setz

SETZ

set byte if zero 

 

test{bwlq}

TEST

logical compare 

testq valid only under -xarch=amd64