x86 Mnemonics 16-bit
The Intel 80286 is a 16-bit microprocessor that introduced several instructions and features which were crucial for the development of modern x86 processors. Below is a detailed list of the key instructions and their descriptions, examples, and usage for the 80286 architecture.
Data Processing Instructions:
ADD (Addition)
Description: Adds two operands and stores the result in the destination operand.
Example:
ADD AX, BXAdds the value in
BXtoAX, storing the result inAX.
SUB (Subtraction)
Description: Subtracts the second operand from the first operand and stores the result in the destination operand.
Example:
SUB AX, BXSubtracts the value in
BXfromAXand stores the result inAX.
MUL (Unsigned Multiplication)
Description: Multiplies the accumulator register (
AX) by the operand, storing the result inDX:AX.Example:
MUL BXMultiplies the value in
AXbyBX, storing the result inDX:AX.
IMUL (Signed Multiplication)
Description: Multiplies the accumulator register (
AX) by the operand, storing the result inDX:AX(signed).Example:
IMUL AX, BXMultiplies the value in
AXbyBX, storing the result inDX:AX.
DIV (Unsigned Division)
Description: Divides the value in
DX:AXby the operand, storing the quotient inAXand the remainder inDX.Example:
DIV BXDivides the value in
DX:AXbyBX, storing the quotient inAXand the remainder inDX.
IDIV (Signed Division)
Description: Divides the value in
DX:AXby the operand (signed division), storing the quotient inAXand the remainder inDX.Example:
IDIV BXDivides the value in
DX:AXbyBX, storing the quotient inAXand the remainder inDX.
INC (Increment)
Description: Increments the operand by 1.
Example:
INC AXIncrements the value in
AXby 1.
DEC (Decrement)
Description: Decrements the operand by 1.
Example:
DEC AXDecrements the value in
AXby 1.
AND (Bitwise AND)
Description: Performs a bitwise AND between two operands and stores the result in the destination operand.
Example:
AND AX, BXPerforms a bitwise AND between
AXandBX, storing the result inAX.
OR (Bitwise OR)
Description: Performs a bitwise OR between two operands and stores the result in the destination operand.
Example:
OR AX, BXPerforms a bitwise OR between
AXandBX, storing the result inAX.
XOR (Bitwise XOR)
Description: Performs a bitwise XOR between two operands and stores the result in the destination operand.
Example:
XOR AX, BXPerforms a bitwise XOR between
AXandBX, storing the result inAX.
NOT (Bitwise NOT)
Description: Performs a bitwise NOT (inversion) of the operand.
Example:
NOT AXPerforms a bitwise NOT on
AX, inverting all bits.
NEG (Negate)
Description: Negates the operand (computes the two's complement).
Example:
NEG AXNegates the value in
AX.
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 AX, 1Shifts the bits of
AXto 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 AX, 1Shifts the bits of
AXto the right by 1, filling with zeros.
ROL (Rotate Left)
Description: Rotates the bits of the operand to the left.
Example:
ROL AX, 1Rotates the bits of
AXto the left by 1.
ROR (Rotate Right)
Description: Rotates the bits of the operand to the right.
Example:
ROR AX, 1Rotates the bits of
AXto the right by 1.
Load and Store Instructions:
MOV (Move)
Description: Copies data from one operand to another.
Example:
MOV AX, BXCopies the value in
BXtoAX.
PUSH (Push onto stack)
Description: Pushes a value onto the stack.
Example:
PUSH AXPushes the value in
AXonto the stack.
POP (Pop from stack)
Description: Pops a value from the stack into a register.
Example:
POP AXPops the top value from the stack into
AX.
LEA (Load Effective Address)
Description: Loads the effective address of a memory operand into a register.
Example:
LEA AX, [BX + 4]Loads the address calculated from
BX + 4intoAX.
MOVZX (Move with Zero Extension)
Description: Moves a value and zero-extends it to a larger size.
Example:
MOVZX AX, BYTE [BX]Moves the byte at the memory address in
BXintoAX, zero-extending it.
MOVSX (Move with Sign Extension)
Description: Moves a value and sign-extends it to a larger size.
Example:
MOVSX AX, BYTE [BX]Moves the byte at the memory address in
BXintoAX, 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 AX, BXCompares the values in
AXandBX.
TEST (Test)
Description: Performs a bitwise AND between two operands and updates the flags.
Example:
TEST AX, BXPerforms a bitwise AND between
AXandBXand 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 provides an overview of the key 80286 instructions, including arithmetic, logic, shifts, branching, stack management, and system calls. The 80286 is more limited compared to modern x86 processors, but it introduced essential features such as protected mode, which paved the way for more advanced processor architectures.