Revised Micro Computer and Interfacing
Revised Micro Computer and Interfacing
CH-1
Introduction to Microprocessor
1. History of Microprocessors
1971 – Intel introduced the first commercial microprocessor, the Intel 4004, a 4-
bit processor designed for calculators.
1974 – Intel released the 8080, an 8-bit processor that became widely used in
early personal computers.
Late 1970s to 1980s – The introduction of 16-bit and 32-bit processors like the
Intel 8086 and 80386 enhanced computing capabilities.
Then decodes it and executes those instructions till STOP instruction is reached.
Between these processes, the register stores the temporarily data and ALU
performs the computing functions.
RISC stands for Reduced Instruction Set Computer. It is designed to reduce the
execution time by simplifying the instruction set of the computer. Using RISC
processors, each instruction requires only one clock cycle to execute results in uniform
execution time. This reduces the efficiency as there are more lines of code, hence more
RAM is needed to store the instructions. The compiler also has to work more to convert
high-level language instructions into machine code.
PA-RISC: HP 7100LC
Architecture of RISC
Characteristics of RISC
“LOAD” and “STORE” instructions are used to access the memory location.
CISC Processor
CISC stands for Complex Instruction Set Computer. It is designed to minimize the
number of instructions per program, ignoring the number of cycles per instruction. The
emphasis is on building complex instructions directly into the hardware.
The compiler has to do very little work to translate a high-level language into assembly
level language/machine code because the length of the code is relatively short, so very
little RAM is required to store the instructions.
IBM 370/168
VAX 11/780
Intel 80486
Architecture of CISC
Its architecture is designed to decrease the memory cost because more storage is
needed in larger programs resulting in higher memory cost. To resolve this, the number
of instructions per program can be reduced by embedding the number of operations in
a single instruction.
Characteristics of CISC
Clock Speed − It determines the number of operations per second the processor
can perform. It is expressed in megahertz (MHz) or gigahertz (GHz). It is also
known as Clock Rate.
Word Length − It depends upon the width of internal data bus, registers, ALU, etc.
An 8-bit microprocessor can process 8-bit data at a time. The word length ranges
from 4 bits to 64 bits depending upon the type of the microcomputer.
Data Types − The microprocessor has multiple data type formats like binary,
BCD, ASCII, signed and unsigned numbers.
CH-2
The 8086 microprocessor has several key features that differentiate it from earlier
processors:
16-bit Processor: The ALU (Arithmetic Logic Unit), internal registers, and data
bus are all 16-bit, allowing it to process 16-bit data at a time.
20-bit Address Bus: Can address up to 1MB (220) of memory using a segmented
memory model.
I/O Addressing: Supports I/O-mapped I/O (64K ports) and memory-mapped I/O
The Bus Interface Unit (BIU) handles memory addressing, instruction fetching, and
communication with peripherals.
The BIU fetches instructions from memory and stores them in the instruction
queue.
Components of BIU:
2. Instruction Queue:
The Execution Unit (EU) decodes and executes instructions fetched by the BIU.
The EU fetches instructions from the queue, decodes them, and executes them.
Components of EU:
2. General-Purpose Registers:
5. Flag Register – Stores status flags (Zero Flag, Carry Flag, etc.).
3. Bus Operation of 8086 Microprocessor
The 8086 microprocessor communicates with memory and I/O devices through three
main buses:
C. Control Bus
Carries control signals such as Read (RD), Write (WR), Interrupt Request (INT),
Clock signals, etc.
Bus Cycles
2. I/O Read/Write Cycle – Transfers data between I/O devices and CPU.
AX – Accumulator
BX – Base Register
CX – Counter
DX – Data Register
CS (Code Segment)
DS (Data Segment)
SS (Stack Segment)
ES (Extra Segment)
SP (Stack Pointer)
BP (Base Pointer)
SI (Source Index)
DI (Destination Index)
(2000H×10H) +1234H=21234H
CH - 3
The 8086 microprocessor provides several addressing modes to access data efficiently.
Each addressing mode specifies how the operands for instructions are selected and
located. Here are the detailed notes and examples for the different addressing modes in
8086:
In this mode, the operand is a constant value (data) provided explicitly in the instruction
itself.
Example:
In this mode, the operand is located in a register. The operand is directly accessed from
one of the processor's registers.
Example:
In this case, the data comes directly from the register BX.
In direct addressing, the operand is located in memory at the address specified by the
instruction. The effective address (EA) is given directly in the instruction.
Example:
MOV AX, [1234h]; Move the data at memory address 1234h into AX
The operand is fetched from memory address 1234h.
MOV AL, [1234H] ; Load AL with the content at memory address 1234H
This mode uses the contents of a register as the address of the operand. The operand
resides in memory at the address stored in the register.
Example:
MOV AX, [DI]; Move the data from the memory address in DI into AX
In this mode, the effective address is the sum of a base register and an index register. It
is useful for accessing elements in arrays or tables.
Example:
MOV AX, [SI + 10]; Move the data at the address SI+10 into AX
This mode combines the use of a base register (e.g., BX, BP) with a direct memory
address or an offset. The base register holds the starting address, and an offset is
added to it to calculate the final memory address.
Example:
MOV AX, [BX + 10]; Move the data at the address (BX+10) into AX
In this example, the value of BX is added with 10 to form the effective address.
The stack addressing mode involves the use of the stack pointer (SP) or base pointer
(BP) register. The operand is accessed from or written to the stack, which is a last-in-
first-out (LIFO) structure.
Example:
MOV AX, [SP + 4]; Move the data from the address (SP+4) into AX
Here, SP holds the current stack pointer, and 4 is the offset from the stack top.
This mode combines both base and index registers to calculate the effective address. It
is commonly used for accessing arrays or structures.
Both base and index registers are used to determine the memory address.
Example:
MOV AX, [BX + SI + 10]; Move the data from the address (BX + SI + 10) into AX
In this case, both BX and SI provide the base and index, and 10 is an additional offset.
Indexed MOV AX, [SI + 10] Operand is in memory at address (SI + 10)
Base-Register MOV AX, [BX + 10] Operand is in memory at address (BX + 10)
These addressing modes allow flexibility in how operands are accessed in 8086
assembly language programming, making it possible to access memory and registers in
various ways for different applications.
The 8086-instruction set is categorized into different groups based on the operations
they perform. These groups include data transfer, arithmetic, logical, control transfer,
string, and processor control instructions. Below is a detailed classification of the 8086
-instruction set
These instructions move data between registers, memory, and I/O ports.
Example:
2. Arithmetic Instructions
Example:
MOV AX, 05H ; Load AX with 5
3. Logical Instructions
These instructions perform bitwise operations such as AND, OR, XOR, NOT, and shifting.
OR OR AX, BX AX = AX | BX
Example:
Example:
MOV CX, 5
LOOP_LABEL:
DEC CX
5. String Instructions
MOVS MOVS BYTE PTR ES: [DI], DS: [SI] Copy string from SI to DI
CMPS CMPS BYTE PTR DS: [SI], ES: [DI] Compare strings
SCAS SCAS BYTE PTR ES: [DI] Scan string for a value
LODS LODS BYTE PTR DS: [SI] Load string element into AL/AX
STOS STOS BYTE PTR ES: [DI] Store AL/AX into a string
Example:
REP MOVS BYTE PTR ES: [DI], DS: [SI] ; Copy CX bytes from DS:SI to ES:DI
Example:
5. How does the 8086 generate a physical address from the segment address?
6. What is the function of the ALU in the Execution Unit (EU) of the 8086?
7. Explain the difference between Pointer and Index Registers and give examples.
9. What is the function of the Bus Interface Unit (BIU) in the 8086?
10. What is the maximum size of the memory that can be addressed by the 8086?
11. What is the difference between the 8086 and 8088 microprocessor?
12. What are the different types of instruction formats in the 8086 microprocessor?
14. What is the role of the Control Unit in the Execution Unit of the 8086?
15. What is the significance of the 16-bit flag register in the 8086?
16. What are the different addressing modes supported by the 8086 microprocessor?
Give 18. 19. 20. What is the role of String Instructions in 8086? List some common
string instructions.
21. Explain the arithmetic operations performed by the 8086. How does the processor
handle multiplication and division?