29.7. x86 bit and byte instructions
Intel 64 and IA-32 Architectures Software Developer’s Manuals Volume 1 5.1.6 "Bit and Byte Instructions"
-
Bit test: test if the Nth bit a bit of a register is set and store the result in the CF FLAG.
CF = reg[N]
-
userland/arch/x86_64/btr.S: BTR
Do a BT and then set the bit to 0.
-
userland/arch/x86_64/btc.S: BTC
Do a BT and then swap the value of the tested bit.
-
userland/arch/x86_64/setcc.S: SETcc
Set a byte of a register to 0 or 1 depending on the cc condition.
-
userland/arch/x86_64/popcnt.S: POPCNT
Count the number of 1 bits.
-
userland/arch/x86_64/test.S: TEST
Like CMP but does AND instead of SUB:
ZF = (!(X && Y)) ? 1 : 0