Logic and the XOR Zeroing Idiom
and rax, 0xff ; keep low byte (mask)
or rax, rbx ; bitwise or
xor rax, rbx ; bitwise xor
not rax ; flip all bits
shr rax, 1 ; logical shift right (unsigned /2)
sar rax, 1 ; arithmetic shift right (signed /2)
xor eax, eax ; <-- IDIOM: set eax = 0
xor reg, regis the standard, compact way to zero a register (smaller/faster thanmov reg, 0).xoralso appears in string/payload de-obfuscation — a red flag when analyzing malware.