Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
32 views

Lab 2

1. The document discusses the structure and components of microprocessors, including the CPU, registers, segments, and flags. 2. It explains the roles of the arithmetic logic unit, control unit, and different types of registers in the CPU, including segment, pointer, index, and general registers. 3. The document also describes the nine flag bits that indicate the status and results of operations.

Uploaded by

Not me
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Lab 2

1. The document discusses the structure and components of microprocessors, including the CPU, registers, segments, and flags. 2. It explains the roles of the arithmetic logic unit, control unit, and different types of registers in the CPU, including segment, pointer, index, and general registers. 3. The document also describes the nine flag bits that indicate the status and results of operations.

Uploaded by

Not me
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Mansoura University

Faculty of Computers and Information


Information Technology Department
Course: Microprocessor
Code: [IT425P]
Fourth Year

LABORATORY MANUAL
Microprocessor
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Microprocessor
Code: [IT425P]
Fourth Year

LAB 02:
Computer structure (8086)

LAB Objectives
The goal of this lab is to be able to recognize microprocessors versions and its capabilities. After
completing this lab students should be able to:
 Understand computer structure.
 Understand different types of registers.
 Understand the function of different registers.
LAB Content
Computer general structure:
CPU:
Is the heart of any computer in the von Neumann structure.
System bus:
Connect the various components of the computer.
Ram:
Is the place where the program is stored for execution.
CPU main components:
ALU Arithmetic and logic unit:
Carries out the logic operation like comparison and arithmetic operation like adding
and multiplying.
Control unit:
It is the traffic manager or policeman or the processor, it monitors the execution and
transfer of the data between CPU and, getting data from rams and decoding
instructions.

2
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Microprocessor
Code: [IT425P]
Fourth Year

Types of registers in CPU(8086):


Segment registers 16bits.
Pointer registers 16bits.
Index registers 16bits.
General registers 16bits.
Flag register 16bits (used nine) six statues flags and three control flags.
Segments (Rams):
Code segment (CS):-
Contains machine code to be executed (may be shared among processes).
Data segment (DS):-
Contains program data & constant (global variables and local variables).
Stack segment (SS):-
Contains data and memory address needed my subroutines.
Extra segment (ES):- coder defines its usage
3
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Microprocessor
Code: [IT425P]
Fourth Year

Cd, DS, SS and ES registers in the CPU contains the addresses of the segments.
Pointer register:
Instruction pointer (IP):-
Address of next instruction to be executed, used for accessing instruction for
execution, cannot be changed by any instruction.
Stack pointer (SP):-
Is used for pointing on the stack of the program in the stack segment, point on
current word in the stack.
Base pointer (BP):-
It points to the data in the stack segment, used for register indirect addressing.
Index registers

Index register is used for moving data from one location (source) to another
location (destination).
Source index:-
Source data address in the string manipulation addressing, indexed, based
indexed and register indirect addressing.
Destination index: -
Destination data address in string manipulation instructions, used for
Indexed, based indexed and register indirect addressing.

4
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Microprocessor
Code: [IT425P]
Fourth Year

General registers

Used for many operations.


AX (accumulator):
It is 16-bit registers, arithmetic or logical instructions.
BX (base register):
This register is used to store the offset values, indirect addressing.
CX (counter register):
is generally used as control register. For different looping and counting
purposes these are used.
DX (data register):
Arithmetic or logical instructions.
General register consists of two bytes and divided into two parts, high order and
low order.
For example: Store (0529)h in AX.

5
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Microprocessor
Code: [IT425P]
Fourth Year

Flag register:

Is modified automatically by CPU after mathematical operations, this allows to


determine the type of the result.
There is nine flags active from the sixteen bits in the flag register divided into
two groups:
Statues flags and control flags.
DF:
Controls the left-to-right or right-to-left direction of string processing
(1), then access the string data from higher memory location towards lower
memory location. (0), then access the string data from lower memory location
towards higher memory location.
IF: interrupt
(1), the microprocessor will recognize interrupt requests from the
peripherals.
(0), the microprocessor will not recognize any interrupt requests and
will ignore them

6
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Microprocessor
Code: [IT425P]
Fourth Year

TF :
Trap (you can step through execution a single instruction at a time to
examine the effect on registers and memory.
Setting trap flag puts the microprocessor into single step mode for
debugging. (1), the CPU automatically generates an internal interrupt
after each instruction. If trap flag is reset (0), no function is performed
INTEL 80186 & 80188:
OF:
Indicate when an arithmetic overflow has occurred in an operation. This
flag will be set (1) if the result of a signed operation is too large to fit in
the number of bits available to represent it, otherwise reset (0).
Sf:
After any operation if the MSB is 1, then it indicates that the number is
negative. And this flag is set to 1, (0=positive, 1= negative).
Zf:
If the result in the register is zero, then only the Z flag is set.

7
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Microprocessor
Code: [IT425P]
Fourth Year

INTEL 80286:
PF:
Indicates if the number of set bits is odd or even in the binary
representation of the result. When result has even number of 1, it will be
set to 1, otherwise 0 for odd number of 1s.
CF: carry.
AF:
Auxiliary carry contains a carry out of 3 bit on 8bit data.
Emulator 8086

Is used to program assembly program on any platform other than 8086.


8086 is one of the most famous architectures in the world pc.
Consisted of the previous mentioned registers (segments, pointers etc.…).
Open the program then click on open emulator to see the previous image.
8
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Microprocessor
Code: [IT425P]
Fourth Year

Homework 01:
Student Name:
Student ID:
Section:
Dept.:
Year:
Date:

1. Solve The Following


a. Explain the Computer general structure.
b. List the types of registers in CPU (8086).
c. Explain the CPU main components
d. List the Segments registers in CPU (8086).
e. Explain the Pointers registers.
f. Explain the Index registers.
g. Explain the General registers.
h. Explain the Flag register.
i. General registers.
j. General registers.

You might also like