8086 Microprocessor Architecture: Assembly Language, Memory Interfacing, and I/O
8086 Microprocessor Architecture
Assembly Language Programming
Assembly language uses mnemonics to represent low-level instructions understood by the microprocessor. The assembler converts these instructions into binary code (0s and 1s) for execution. Here are some key rules for 8086 assembly language programming:
- Code must be written in uppercase letters.
- Labels must be followed by a colon (e.g., label:).
- Labels and symbols must begin with a letter.
- Comments are typed in lowercase.
- The program must end with the END directive.
The 8086 processor uses instructions like MOV to transfer data and SUB to perform subtraction. It also supports data access using WORD PTR (for 2 bytes) and BYTE PTR (for 1 byte).
Macros and Procedures
Macros and procedures help avoid repetitive code. A macro is a group of instructions defined once and inserted by the assembler wherever called. Procedures, on the other hand, are subroutines that the program calls and returns from.
Advantages of Procedures:
- Machine code is stored only once.
Disadvantages of Procedures:
- Requires stack usage.
- Overhead time for calling and returning.
Advantages of Macros:
- Avoids overhead time of procedure calls.
Disadvantages of Macros:
- Increases program size due to in-line code generation.
Address and Data Bus
The 8086 microprocessor has a 16-bit address/data bus (AD15-AD0) and a 4-bit address/status bus (A19/S6-A16/S3) that operate in time-multiplexed mode. The ALE (Address Latch Enable) signal separates the address from the data. Latch ICs like 74LS373 are used to demultiplex the 20-bit address lines. The data bus is bi-directional and separated using buffers like 74245. Control signals DEN (Data Enable) and DT/R (Data Transmit/Receive) manage data flow.
Input/Output (I/O)
The 8086 uses IN and OUT instructions for data transfer between I/O devices and the accumulator (AL, AX, or EAX). The I/O address can be specified in register DX or directly in the instruction. Instructions like INS and OUTS use ES:DI and DS:SI for I/O data transfer.
I/O ports can be 8-bit, 16-bit, or 32-bit. Address decoding ensures that the correct device is selected for communication. High impedance buffers like 74ALS244 are often used in I/O circuits.
Memory Interfacing
RAM and ROM
Memory is crucial for storing instructions and data. The 8086 system typically includes both RAM (Random Access Memory) for temporary data and ROM (Read-Only Memory) for permanent data and system software.
The 8086’s 16-bit data bus requires special handling for byte-oriented memory chips. The memory is divided into two banks: Bank0 (even addresses) and Bank1 (odd addresses). Control signals BHE and A0 enable the appropriate bank for data transfer.
Address Decoding Techniques
Address decoding ensures that the correct memory location is accessed. Common techniques include:
- **Absolute Decoding:** Each memory chip has a unique address range, providing precise control but requiring more complex circuitry.
- **Linear Decoding:** Only a subset of address lines is used, simplifying the circuit but potentially creating multiple addresses for the same location (shadow addresses).
- **Block Decoding:** Decoder ICs are used to generate chip select signals for blocks of memory, balancing cost and complexity.
Understanding these concepts is essential for designing and working with 8086 microprocessor systems.
