Understanding the 80386 Microprocessor: Architecture, Addressing Modes, and Instructions
80386 Addressing Modes
Index Addressing Mode
Description: In index addressing mode, the effective address of the operand is calculated by adding an index value to a base address.
Example: MOV EAX, [ESI + 100]
In this example, the contents of the ESI register (base address) are added to the constant value 100 (index) to calculate the effective address. The data stored at this effective address is then moved into the EAX register.
Direct Addressing Mode
Description: In direct addressing mode, the operand directly specifies the memory location where the data is stored.
Example: MOV EBX, [0xABCD]
Here, the data stored at memory location 0xABCD is moved into the EBX register.
Based Index Mode
Description: Based index addressing mode combines elements of both index and base addressing modes. It involves adding an index value to a base address and then using the result as the address to access memory.
Example: MOV EDX, [EBX + ECX*4]
80386 Data Movement Instructions
MOV (Move)
Description: The MOV instruction is used to move data from a source operand to a destination operand. It can transfer data between registers, memory locations, and immediate values.
Example: MOV AX, BX copies the contents of register BX to register AX.
XCHG (Exchange)
Description: The XCHG instruction swaps the contents of two operands. It can exchange values between registers or between a register and a memory location.
Example: XCHG AX, BX swaps the values in registers AX and BX.
PUSH (Push onto Stack)
Description: The PUSH instruction pushes the source operand onto the top of the stack. It decrements the stack pointer and stores the value in the memory location pointed to by the stack pointer.
Example: PUSH AX pushes the value in register AX onto the stack.
POP (Pop from Stack)
Description: The POP instruction retrieves the value from the top of the stack and stores it in the destination operand. It increments the stack pointer.
Example: POP BX pops the value from the stack and stores it in register BX.
Features of the 80386
- 32-bit ALU and data bus
- 32-bit address bus supporting 4GB physical and 64TB virtual memory
- Operating clock frequencies: 16 MHz, 20 MHz, 25 MHz, and 33 MHz
- 3-stage pipeline: fetch, decode, and execute
- Integrated Memory Management Unit (MMU)
- Segmentation and Paging support
- 4 Levels of Protection
Architecture of the 80386 Microprocessor
Key Components:
- Execution Unit (EU): Contains the Arithmetic Logic Unit (ALU) for arithmetic and logical operations. It also includes registers to hold data operands.
- Bus Interface Unit (BIU): Manages communication between the processor and external components like memory and I/O devices. Coordinates address and data transfers.
- Control Unit (CU): Fetches and decodes instructions, generating control signals to coordinate operations of the ALU, registers, and BIU.
- Prefetch Unit: Fetches instructions from memory based on the program counter (PC) register and supplies them to the decode unit.
- Registers: The 80386 has general-purpose registers, segment registers, and control registers for storing data and control flags.
Register Addressing Mode
Description: In register addressing mode, the operand is directly specified by a register.
Example: MOV AX, BX
In this example, the data in register BX is moved to register AX.
Register Indirect Addressing Mode
Description: In register indirect addressing mode, the operand is a memory address stored in a register. The data at that memory address is accessed.
Example: MOV AX, [BX]
Here, the contents of the memory location whose address is stored in register BX are moved to register AX.
Immediate Addressing Mode
Description: In immediate addressing mode, the operand is a constant value specified directly in the instruction itself.
Example: MOV AX, 1000h
In this example, the immediate value 1000h is moved into register AX.
