# x86-64 Registers & flags

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

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

The general purpose registers, the flags, the SSE and x87 registers and the condition codes.

47 entries, each with its own page of markdown:

- [Registers](https://asm-editor.specy.app/documentation/x86/registers/registers.md): Sixteen 64 bit general purpose registers.
- [`rax`](https://asm-editor.specy.app/documentation/x86/registers/register-rax.md) `eax, ax, ah, al`: The accumulator.
- [`rbx`](https://asm-editor.specy.app/documentation/x86/registers/register-rbx.md) `ebx, bx, bh, bl`: A general register.
- [`rcx`](https://asm-editor.specy.app/documentation/x86/registers/register-rcx.md) `ecx, cx, ch, cl`: The counter.
- [`rdx`](https://asm-editor.specy.app/documentation/x86/registers/register-rdx.md) `edx, dx, dh, dl`: The high half of the product mul writes and of the dividend div reads, and the third argument of a function call or a syscall.
- [`rsi`](https://asm-editor.specy.app/documentation/x86/registers/register-rsi.md) `esi, si, sil`: The source pointer of the string instructions, and the second argument of a function call or a syscall.
- [`rdi`](https://asm-editor.specy.app/documentation/x86/registers/register-rdi.md) `edi, di, dil`: The destination pointer of the string instructions, and the first argument of a function call or a syscall.
- [`rbp`](https://asm-editor.specy.app/documentation/x86/registers/register-rbp.md) `ebp, bp, bpl`: The frame pointer by convention, pointing at the base of the current function's stack frame.
- [`rsp`](https://asm-editor.specy.app/documentation/x86/registers/register-rsp.md) `esp, sp, spl`: The stack pointer.
- [`r8 to r15`](https://asm-editor.specy.app/documentation/x86/registers/register-r8-to-r15.md) `r8d to r15d, r8w to r15w, r8b to r15b`: The eight registers x86-64 added.
- [`rip`](https://asm-editor.specy.app/documentation/x86/registers/register-rip.md): The instruction pointer.
- [`rflags`](https://asm-editor.specy.app/documentation/x86/registers/register-rflags.md) `eflags, flags`: The flags, listed below.
- [Flags](https://asm-editor.specy.app/documentation/x86/registers/flags.md): The flags live in rflags.
- [`CF`](https://asm-editor.specy.app/documentation/x86/registers/flag-cf.md) `bit 0`: Carry.
- [`PF`](https://asm-editor.specy.app/documentation/x86/registers/flag-pf.md) `bit 2`: Parity.
- [`AF`](https://asm-editor.specy.app/documentation/x86/registers/flag-af.md) `bit 4`: Adjust.
- [`ZF`](https://asm-editor.specy.app/documentation/x86/registers/flag-zf.md) `bit 6`: Zero.
- [`SF`](https://asm-editor.specy.app/documentation/x86/registers/flag-sf.md) `bit 7`: Sign.
- [`DF`](https://asm-editor.specy.app/documentation/x86/registers/flag-df.md) `bit 10`: Direction.
- [`OF`](https://asm-editor.specy.app/documentation/x86/registers/flag-of.md) `bit 11`: Overflow.
- [SSE registers](https://asm-editor.specy.app/documentation/x86/registers/sse.md): Floating point arithmetic in a 64 bit program is SSE arithmetic.
- [`xmm0 to xmm15`](https://asm-editor.specy.app/documentation/x86/registers/sse-xmm0-to-xmm15.md) `128 bit`: Sixteen 128 bit registers.
- [`mxcsr`](https://asm-editor.specy.app/documentation/x86/registers/sse-mxcsr.md) `32 bit`: The control and status register of the unit.
- [AVX registers](https://asm-editor.specy.app/documentation/x86/registers/avx.md): AVX doubles the width of the vector registers.
- [`ymm0 to ymm15`](https://asm-editor.specy.app/documentation/x86/registers/avx-ymm0-to-ymm15.md) `256 bit`: Sixteen 256 bit registers.
- [x87 registers](https://asm-editor.specy.app/documentation/x86/registers/x87.md): The x87 unit is the floating point hardware x86 had before SSE, and it is still what the f instructions use.
- [`st0 to st7`](https://asm-editor.specy.app/documentation/x86/registers/x87-st0-to-st7.md) `64 bit`: The stack registers, listed top first: what the panel calls st0 is whatever the last push left on top, and one more push moves that value to st1.
- [`fctrl`](https://asm-editor.specy.app/documentation/x86/registers/x87-fctrl.md) `16 bit`: The control word: the rounding mode, the precision the unit rounds results to, and the masks that say which exceptions the program wants to be told about.
- [`fstat`](https://asm-editor.specy.app/documentation/x86/registers/x87-fstat.md) `16 bit`: The status word: the exception flags, the condition codes a comparison such as fcom writes, and the three bits that say which register is currently the top of…
- [`ftag`](https://asm-editor.specy.app/documentation/x86/registers/x87-ftag.md) `16 bit`: Two bits per register saying whether it holds a number, a zero, a special value such as an infinity, or nothing at all.
- [Condition codes](https://asm-editor.specy.app/documentation/x86/registers/condition-codes.md): The same sixteen conditions end jcc, setcc and cmovcc: jne jumps, setne writes 1 or 0 to a byte, and cmovne copies a register, all on the same test.
- [`e`](https://asm-editor.specy.app/documentation/x86/registers/condition-e.md) `ZF = 1`: Equal, zero
- [`ne`](https://asm-editor.specy.app/documentation/x86/registers/condition-ne.md) `ZF = 0`: Not equal, not zero
- [`a`](https://asm-editor.specy.app/documentation/x86/registers/condition-a.md) `CF = 0 and ZF = 0`: Above (unsigned)
- [`ae`](https://asm-editor.specy.app/documentation/x86/registers/condition-ae.md) `CF = 0`: Above or equal (unsigned)
- [`b`](https://asm-editor.specy.app/documentation/x86/registers/condition-b.md) `CF = 1`: Below (unsigned)
- [`be`](https://asm-editor.specy.app/documentation/x86/registers/condition-be.md) `CF = 1 or ZF = 1`: Below or equal (unsigned)
- [`g`](https://asm-editor.specy.app/documentation/x86/registers/condition-g.md) `ZF = 0 and SF = OF`: Greater (signed)
- [`ge`](https://asm-editor.specy.app/documentation/x86/registers/condition-ge.md) `SF = OF`: Greater or equal (signed)
- [`l`](https://asm-editor.specy.app/documentation/x86/registers/condition-l.md) `SF is not OF`: Less (signed)
- [`le`](https://asm-editor.specy.app/documentation/x86/registers/condition-le.md) `ZF = 1 or SF is not OF`: Less or equal (signed)
- [`s`](https://asm-editor.specy.app/documentation/x86/registers/condition-s.md) `SF = 1`: Sign set, negative
- [`ns`](https://asm-editor.specy.app/documentation/x86/registers/condition-ns.md) `SF = 0`: Sign clear, not negative
- [`o`](https://asm-editor.specy.app/documentation/x86/registers/condition-o.md) `OF = 1`: Overflow
- [`no`](https://asm-editor.specy.app/documentation/x86/registers/condition-no.md) `OF = 0`: No overflow
- [`p`](https://asm-editor.specy.app/documentation/x86/registers/condition-p.md) `PF = 1`: Parity even
- [`np`](https://asm-editor.specy.app/documentation/x86/registers/condition-np.md) `PF = 0`: Parity odd
