x64 Mnemonics
Here is a detailed list of x86_64 mnemonics along with their descriptions, examples, and usage:
Data Processing Instructions:
ADD (Addition)
Description: Adds two operands and stores the result in the destination operand.
Example:
ADD RAX, RBXAdds the value in
RBXtoRAX, storing the result inRAX.
SUB (Subtraction)
Description: Subtracts the second operand from the first operand and stores the result in the destination operand.
Example:
SUB RAX, RBXSubtracts the value in
RBXfromRAXand stores the result inRAX.
MUL (Unsigned Multiplication)
Description: Multiplies the accumulator register (
RAX/EAX/AX) by the operand, storing the result inRDX:RAX.Example:
MUL RBXMultiplies the value in
RAXbyRBX, storing the result inRDX:RAX.
IMUL (Signed Multiplication)
Description: Multiplies the accumulator register (
RAX/EAX/AX) by the operand, storing the result inRDX:RAX(signed).Example:
IMUL RAX, RBXMultiplies the value in
RAXbyRBX, storing the result inRDX:RAX.
DIV (Unsigned Division)
Description: Divides the value in the accumulator register (
RDX:RAX) by the operand and stores the result inRAX(quotient) andRDX(remainder).Example:
DIV RBXDivides the value in
RDX:RAXbyRBX, storing the quotient inRAXand the remainder inRDX.
IDIV (Signed Division)
Description: Divides the value in the accumulator register (
RDX:RAX) by the operand (signed division), storing the quotient inRAXand the remainder inRDX.Example:
IDIV RBXDivides the value in
RDX:RAXbyRBX, storing the quotient inRAXand the remainder inRDX.
INC (Increment)
Description: Increments the operand by 1.
Example:
INC RAXIncrements the value in
RAXby 1.
DEC (Decrement)
Description: Decrements the operand by 1.
Example:
DEC RAXDecrements the value in
RAXby 1.
AND (Bitwise AND)
Description: Performs a bitwise AND between two operands and stores the result in the destination operand.
Example:
AND RAX, RBXPerforms a bitwise AND between
RAXandRBX, storing the result inRAX.
OR (Bitwise OR)
Description: Performs a bitwise OR between two operands and stores the result in the destination operand.
Example:
OR RAX, RBXPerforms a bitwise OR between
RAXandRBX, storing the result inRAX.
XOR (Bitwise XOR)
Description: Performs a bitwise XOR between two operands and stores the result in the destination operand.
Example:
XOR RAX, RBXPerforms a bitwise XOR between
RAXandRBX, storing the result inRAX.
NOT (Bitwise NOT)
Description: Performs a bitwise NOT (inversion) of the operand.
Example:
NOT RAXPerforms a bitwise NOT on
RAX, inverting all bits.
NEG (Negate)
Description: Negates the operand (computes the two's complement).
Example:
NEG RAXNegates the value in
RAX.
Shift and Rotate Instructions:
SHL (Shift Left)
Description: Shifts the bits of the operand to the left, inserting zeros into the least significant bits.
Example:
SHL RAX, 1Shifts the bits of
RAXto the left by 1, filling with zeros.
SHR (Shift Right)
Description: Shifts the bits of the operand to the right, inserting zeros into the most significant bits.
Example:
SHR RAX, 1Shifts the bits of
RAXto the right by 1, filling with zeros.
SAR (Arithmetic Shift Right)
Description: Shifts the bits of the operand to the right, preserving the sign bit (for signed integers).
Example:
SAR RAX, 1Shifts the bits of
RAXto the right by 1, preserving the sign bit.
ROL (Rotate Left)
Description: Rotates the bits of the operand to the left.
Example:
ROL RAX, 1Rotates the bits of
RAXto the left by 1.
ROR (Rotate Right)
Description: Rotates the bits of the operand to the right.
Example:
ROR RAX, 1Rotates the bits of
RAXto the right by 1.
Load and Store Instructions:
MOV (Move)
Description: Copies data from one operand to another.
Example:
MOV RAX, RBXCopies the value in
RBXtoRAX.
PUSH (Push onto stack)
Description: Pushes a value onto the stack.
Example:
PUSH RAXPushes the value in
RAXonto the stack.
POP (Pop from stack)
Description: Pops a value from the stack into a register.
Example:
POP RAXPops the top value from the stack into
RAX.
LEA (Load Effective Address)
Description: Loads the effective address of a memory operand into a register.
Example:
LEA RAX, [RBX + RCX*4]Loads the address calculated from
RBX + RCX*4intoRAX.
MOVZX (Move with Zero Extension)
Description: Moves a value and zero-extends it to a larger size.
Example:
MOVZX RAX, BYTE [RBX]Moves the byte at the memory address in
RBXintoRAX, zero-extending it.
MOVSX (Move with Sign Extension)
Description: Moves a value and sign-extends it to a larger size.
Example:
MOVSX RAX, BYTE [RBX]Moves the byte at the memory address in
RBXintoRAX, sign-extending it.
Branch Instructions:
JMP (Jump)
Description: Unconditionally jumps to a target address.
Example:
JMP labelJumps to the instruction at the label.
JE (Jump if Equal)
Description: Jumps to a target address if the zero flag is set (i.e., if the two operands were equal).
Example:
JE labelJumps to the label if the zero flag is set.
JNE (Jump if Not Equal)
Description: Jumps to a target address if the zero flag is cleared (i.e., if the operands were not equal).
Example:
JNE labelJumps to the label if the zero flag is cleared.
JL (Jump if Less)
Description: Jumps to a target address if the signed comparison is less.
Example:
JL labelJumps to the label if the signed comparison is less.
JLE (Jump if Less or Equal)
Description: Jumps to a target address if the signed comparison is less or equal.
Example:
JLE labelJumps to the label if the signed comparison is less or equal.
JGE (Jump if Greater or Equal)
Description: Jumps to a target address if the signed comparison is greater or equal.
Example:
JGE labelJumps to the label if the signed comparison is greater or equal.
JMP (Jump)
Description: An unconditional jump to a specified address.
Example:
JMP labelJumps to
labelunconditionally.
Comparison Instructions:
CMP (Compare)
Description: Compares two operands by subtracting them and updating the flags.
Example:
CMP RAX, RBXCompares the values in
RAXandRBX.
TEST (Test)
Description: Performs a bitwise AND between two operands and updates the flags.
Example:
TEST RAX, RBXPerforms a bitwise AND between
RAXandRBXand updates the flags.
Stack Management Instructions:
CALL (Call Function)
Description: Calls a function, pushing the return address onto the stack.
Example:
CALL funcCalls the function
func.
RET (Return from Function)
Description: Pops the return address from the stack and returns to that address.
Example:
RETPops the return address and returns to it.
Miscellaneous Instructions:
NOP (No Operation)
Description: Does nothing; typically used for padding or alignment.
Example:
NOPNo operation.
HLT (Halt)
Description: Stops the processor.
Example:
HLTHalts execution.
CLD (Clear Direction Flag)
Description: Clears the direction flag, ensuring string operations auto-increment addresses.
Example:
CLDClears the direction flag.
STD (Set Direction Flag)
Description: Sets the direction flag, ensuring string operations auto-decrement addresses.
Example:
STDSets the direction flag.
System Instructions:
SYSENTER (System Enter)
Description: Used for fast system calls.
Example:
SYSENTER
SYSCALL (System Call)
Description: Triggers a system call.
Example:
SYSCALLIssues a system call to the operating system.
This list covers a wide range of x86_64 mnemonics, including instructions for arithmetic, logic, shifts, branching, stack management, system calls, and more.