Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
X86 assembly language
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== General-purpose registers === * AX (Accumulator register): Primarily used in arithmetic, logic, and data transfer operations. It is favored by instructions that perform multiplication and division, and by string load and store operations. * BX (Base register): Base pointer for memory access. It can hold the base address of data structures and is useful in indexed addressing modes, particularly with the {{Code|MOV|asm}} instruction. * CX (Count register): Serves as a counter in loop, string, and shift/rotate instructions. Iterative operations often use CX to determine the number of times a loop or operation should execute. * DX (Data register): Used in conjuction with AX for multiplication and division operations that produce results larger than 16 bits. It also holds I/O port addresses in IN and OUT instructions. * SP (Stack pointer): Points to the top of [[Stack (abstract data type)|stack]] in memory. It is automatically updated during {{Code|PUSH|asm}} and {{Code|POP|asm}} operations. * BP (Base Pointer): Points to the top of the [[call stack]]. It is primarily used to access function parameters and local variables within the call stack. * SI (Source Index): Used as a pointer to the source in string and memory array operations. Instructions like {{Code|MOVS|asm}} (move string) use SI to read data from memory. * DI (Destination Index): Serves as a pointer to the destination in string and memory array operations. It works alongside SI in instructions that copy or compare data, writing results to memory. Along with the general registers there are additionally the: * Instruction Pointer (IP): Holds the offset address of the next instruction to be executed within the code segment (CS). It points to the first byte of the next instruction. While the IP register cannot be accessed directly by programmers, its value changes through control flow instructions such as jumps, calls, and interrupts, which alter the flow of execution. * [[FLAGS register (computing)|FLAGS]] register: Contains a set of status, control, and system flags that reflect the outcome of operations and control the processor's operations. * Segment registers (CS, DS, ES, FS, GS, SS): Determine where a 64k segment starts (no FS & GS in [[Intel 80286|80286]] & earlier) * Extra extension registers ([[MMX (instruction set)|MMX]], [[3DNow!]], [[Streaming SIMD Extensions|SSE]], etc.) (Pentium & later only). The IP register points to the memory offset of the next instruction in the code segment (it points to the first byte of the instruction). The IP register cannot be accessed by the programmer directly. The x86 registers can be used by using the [[MOV (x86 instruction)|MOV]] instructions. For example, in Intel syntax: <syntaxhighlight lang="nasm">mov ax, 1234h ; copies the value 1234hex (4660d) into register AX</syntaxhighlight> <syntaxhighlight lang="nasm">mov bx, ax ; copies the value of the AX register into the BX register</syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)