# `sete`

[x86-64 Documentation](https://asm-editor.specy.app/documentation/x86.md) › [Instructions](https://asm-editor.specy.app/documentation/x86/instruction.md)

Web page: https://asm-editor.specy.app/documentation/x86/instruction/sete

**Set byte if equal (ZF == 1)**

Category: Comparison

Sets the destination byte to 1 when the last comparison found equal (ZF is 1), otherwise to 0.

386 and later

Also written as: `setz`

[Intel's reference: SETcc](https://intel.github.io/SDM/instruction/SETcc.html)

Used in: [Arithmetic, logic and bits](https://asm-editor.specy.app/learn/courses/x86/think-in-assembly/arithmetic-logic-and-bits.md) (x86-64 assembly), [Arrays, strings and the string instructions](https://asm-editor.specy.app/learn/courses/x86/think-in-assembly/arrays-strings-and-the-string-instructions.md) (x86-64 assembly), [Even or odd, count the set bits, multiply by shifting](https://asm-editor.specy.app/learn/courses/x86/examples/bit-tricks.md) (x86-64 assembly)

## Flags

| Flag | Effect |
| --- | --- |
| CF | not changed |
| PF | not changed |
| AF | not changed |
| ZF | not changed |
| SF | not changed |
| DF | not changed |
| OF | not changed |

Reads: ZF

## Forms

- `sete r/m8`

## Operands

- `r/m8`: An 8-bit general-purpose register or byte in memory, for example `al` or `byte [rsi]`. The high-byte registers `ah`, `bh`, `ch` and `dh` cannot be used in an instruction that also uses a 64-bit operand, `spl`, `bpl`, `sil`, `dil`, or `r8` to `r15` at any size.

## Example

```x86
global _start

section .text
_start:
        mov rax, 12
        cmp rax, 12
        sete bl             ; bl becomes 1 when the condition holds, 0 when it does not

        mov rax, 60         ; syscall 60: exit
        xor rdi, rdi
        syscall
```
