8086 Instruction Sets
The x86 architecture found in contemporary computers is derived from the instruction set design of the Intel 8086, a 16-bit microprocessor. Its instruction set consists of a variety of instructions that are arranged according to their functions:
1. Instructions for Data Transfer:
Data is moved between registers, memory regions, and immediate values with the MOV command.
XCHG: Switches two operands' contents.
Data can be pushed onto or popped off of a stack using the push/pop method.
LEA: Inserts the source operand's effective address into the destination operand.
2. Instructions in Arithmetic:
ADD, SUB, INC, DEC: Carry out operations related to addition, subtraction, increment, and decrement.
Execute signed and unsigned division and multiplication operations using MUL, IMUL, DIV, and IDIV.
ADC, SBB: Use carry for addition and borrow for subtraction.
3. Logical Instructions:
Carry out bitwise logical operations with AND, OR, XOR, and NOT.
TEST: Uses bitwise AND to operate on two operands without saving the outcome.
4. Instructions for Control Transfer:
JMP: Jump to a different place in the code unconditionally.
Call a subroutine and exit the procedure using the CALL/RET command.
Jcc: Conditional jump (e.g., JE for Jump if Equal) dependent on specific criteria.
5. Instructions for Strings:
Move words, bytes, or double words between locations within strings using MOVSB, MOVSW, and MOVSD.
Compare bytes, words, or double-words inside strings using CMPSB, CMPSW, and CMPSD.
Use SCASB, SCASW, and SCASD to search for bytes, words, or double words in a string.
6. Instructions for Flag Control:
CLC, STC, CLI, STI: Disable or enable interrupts; clear or set the carry flag.
CMC: Enhance the carry signal.
7. Instructions for Input/Output:
I/O port read from the IN port.
Write to an I/O port using OUT.
8. Miscellaneous Instructions:
NOP: No action (makes no difference).
HLT: Stop the CPU and wait for an interrupt.
Wait for memory or the coprocessor.
INT: Produce an interruption in software.