Lab Micro-Processor, Micro-Controller and Interfacing:: Basic Part 1
Lab Micro-Processor, Micro-Controller and Interfacing:: Basic Part 1
Interfacing:
Basic part 1
Book read
Assembly language programming Ytha Yu
Chapter 3.2 Organization of. The 8086 Microprocessors
Prepared by:
Nasif M. (Lecturer, Dept. of CSE, UIU.)
Department of Computer Science & Engineering (CSE), United International University (UIU).
8086 Micro-processor (Internal architecture)
Department of Computer Science & Engineering (CSE), United International University (UIU).
Execution Unit (EU)
Department of Computer Science & Engineering (CSE), United International University (UIU).
Bus Interface Unit (BIU)
Department of Computer Science & Engineering (CSE), United International University (UIU).
CPU Registers
• General purpose registers
• Segment registers
• Pointer and Index Registers
• Flags register
Department of Computer Science & Engineering (CSE), United International University (UIU).
General Purpose Registers
AX (accumulator register):
Stores operands for arithmetic & data transfer instructions.
6
General Purpose Registers (contd.)
Each of these 16-bit registers are further subdivided into two 8-bit
registers.
AX AH AL
BX BH BL
CX CH CL
DX DH DL
7
Memory Segmentation registers
ES
64 KB
SS
64 KB
CS
64 KB
DS
64 KB
8086 Memory 8
Pointer and Index registers
IP: Instruction Pointer
Points to Next Instruction in code Memory.
SP: Stack pointer
Pointer to the top of the stack.
BP: Base Pointer
- Used to point to the base of the stack.
SI & DI: Source and Destination Index
register
is required for string operation
Flag Register
10
Flag Register (contd.)
11
Flag Register (contd.)
Flag Purpose
Carry (CF) CF = 1 if there is a carry out from the MSB on addition or
there is a Borrow into the MSB on subtraction.
Parity (PF) PF=1 if the low byte of a result has an even number of one bits
(even parity).
Auxiliary (AF) Holds the carry (half–carry) after addition or borrow after
subtraction between bit positions 3 and 4 of the result
(for example, in BCD addition or subtraction.)
Zero (ZF) Shows the result of the arithmetic or logic operation.
Z=1; result is zero. Z=0; The result is 0
Sign (SF) Holds the sign of the result after an arithmetic/logic instruction
execution. SF=1 if the MSB of a result is 1.
12
Flag Register (contd.)
Flag Purpose
Trap (TF) Enables the trapping through an on-chip debugging feature.
13
Segmentation and offset
Book chapter: 3.2.3 Segment Registers
14
Segmentation and offset
Book chapter: Ytha yu 3.2.3 Segment Registers
Memory Segment