setc
Set byte if carry (CF == 1)
Sets the 8-bit operand to 1 if the carry flag is set, and to 0 otherwise.
386 and later
Used in
- Arithmetic, logic and bitsx86-64 assembly
- Even or odd, count the set bits, multiply by shiftingx86-64 assembly
CFPFAFZFSFDFOF –––––––
- Changes no flag
- Reads CF
Forms
setc
Operands
r/m8- An 8-bit general-purpose register or byte in memory, for example
alorbyte [rsi]. The high-byte registersah,bh,chanddhcannot be used with a REX prefix, including when the memory address uses an extended register such asr8.
global _start
section .text
_start:
mov rax, 12
cmp rax, 12
setc bl ; bl becomes 1 when the condition holds, 0 when it does not
mov rax, 60 ; syscall 60: exit
xor rdi, rdi
syscall