Skip to content

Glossary

RSI Register

RSI is the 64-bit x86-64 source-index register, used as the source pointer in string operations and as a function argument on System V.

RSI is a 64-bit general-purpose register in the x86-64 architecture, extending ESI. The name means source index: in string and block instructions such as movs, lods, and cmps, RSI is the implicit source pointer, automatically advanced by the direction flag after each element.

The two ABIs treat RSI very differently as an argument register. In the System V AMD64 ABI (Linux, macOS), RSI is the second integer/pointer argument and is caller-saved. In the Microsoft x64 ABI (Windows), RSI is not an argument register at all — it is callee-saved (non-volatile), so a Windows function must preserve it before use.

Sub-registers

asm
lea rsi, [src]       ; source pointer
lea rdi, [dst]       ; destination pointer
mov rcx, len
rep movsb            ; copy RCX bytes from RSI to RDI
; esi = low 32 bits (zeroes upper half on write)
; si  = low 16 bits
; sil = low 8 bits

Why it matters in reverse engineering

In a rep movs/cmps loop, RSI always points at the data being read — knowing this lets you immediately identify the source buffer of a copy or comparison. As an argument register it is the second parameter on Linux, but on Windows a push rsi in the prologue signals it is being preserved, not passed.

See the general register concept and the assembly reference. The ABI split is detailed in x86 vs x64 assembly. It works hand in hand with the RDI register, the destination of the same operations.