=

x64 Registers

Registers are the small memory unit which are placed inside the CPU. In x86-64 architecture , 64 bit registers are used(excluding extended registers). example ➼ rax, rcx, rdx etc.

Total number of registers in a cpu may vary, but in general perpose 16 registers are used.

Introduction to x64 registers.

Registers are the small size memory units placed inside the cpu. Registers holds data such as variables , memory addresses and other informations. These are more faster than other types of memory. Many of the registers have its lower (32bit, 16bit,8bit) parts that makes it flexible. For example following is a general purpose RAX register >>

RAX EAX AX AH AL (64 bits) (32 bits) (16 bits) (8bits) (8bits) RAX register

General-Purpose Registers (GPRs)

General purpose register are the most important registers. These registers are generally used for arithmetic operations, data storage, and as temporary storage during function calls. In x64 , 16 general purpose registers are there -

Flags Register

In a x64 cpu core , there is a single RFLAGS register with the size of 64bits. It contains many flags in it's bytes.
Here is the breakdown of 64 bits -

bitFlag nameDescription
0CF (Carry)Indicates a carry or borrow out of the most significant bit in arithmetic operations.
1ReservedAlways set to 1
2PF (Parity)Indicates whether the number of 1-bits in the least significant byte of the result is even.
3ReservedUndefined or unused
4AF (Auxiliary Carry)Used for binary-coded decimal (BCD) operations, indicating a carry from bit 3 to bit 4.
5ZF (Zero)Set if the result of an operation is zero
6SF (Sign)Reflects the sign of the result (0 = positive, 1 = negative)
7TF (Trap)Enables single-step debugging by generating an exception after each instruction
8IF (Interrupt)Controls whether maskable interrupts are enabled (1 = enabled)
9DF (Direction)Controls string operations: 0 = auto-increment, 1 = auto-decrement
10OF (Overflow)Indicates whether the signed result of an operation exceeds the range of the destination
11-12IOPL (I/O Privilege Level)Indicates the I/O privilege level for the current task
13NT (Nested Task)Indicates whether the current task is nested inside another
14ReservedUndefined or unused
15RF (Resume)Used to control debugging exceptions
16VM (Virtual 8086 Mode)Enables Virtual 8086 mode if set.
17AC (Alignment Check)Enables alignment checking of memory accesses.
18VIF (Virtual Interrupt)Virtual version of IF flag for virtualization.
19VIP (Virtual Interrupt Pending)Indicates that a virtual interrupt is pending.
20ID (Identification)Allows CPUID instruction to execute if set.
21-63ReservedUnused or reserved.