Skip to content

Glossary

RDX Register

RDX is the 64-bit x86-64 data register, an argument register that also holds the high half of multiply and divide results.

RDX is a 64-bit general-purpose register in the x86-64 architecture, the extension of EDX. The "D" stands for data. Its defining special role is in wide arithmetic: RDX:RAX together form a 128-bit pair, so mul/imul place the upper 64 bits of a product in RDX, and div/idiv read the dividend's high half from RDX and leave the remainder there.

As an argument register, RDX is consistent across conventions in a way the others are not. In the System V AMD64 ABI it is the third integer argument; in the Microsoft x64 ABI it is the second. In both ABIs RDX is caller-saved (volatile). System V also uses RDX as a secondary return register for 128-bit results returned in RAX:RDX.

Sub-registers

asm
xor edx, edx         ; clear high half before unsigned divide
mov rax, 100
div rcx              ; RAX = quotient, RDX = remainder
; edx = low 32 bits (zeroes upper half on write)
; dx  = low 16 bits
; dl  = low 8 bits

Why it matters in reverse engineering

Spotting xor edx, edx right before a div tells you the code is doing an unsigned division and clearing the high dividend — a common idiom. As an argument register, RDX is the third arg on Linux and the second on Windows, so its meaning depends on the target ABI.

See the general register concept and the assembly reference. For ABI specifics see x86 vs x64 assembly. It pairs with the RAX register for 128-bit math and follows the RCX register in the argument order.