0% found this document useful (0 votes)
156 views14 pages

Faculty of Engineering: Laboratory Report Cover Sheet

This laboratory report covers an experiment on the 8086 microprocessor. The objectives are to work with advanced 8086 instructions and learn how to write assembly programs using 8086 instructions and arrays. The report describes the internal architecture of the 8086, including its registers and pin diagram. It discusses the general purpose registers (AX, BX, CX, DX, SI, DI, BP, SP), segment registers (CS, DS, ES, SS), and special purpose registers (IP and flags register) of the 8086 microprocessor. The theory and methodology section provides details on the functions and usage of these registers.

Uploaded by

Arif Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views14 pages

Faculty of Engineering: Laboratory Report Cover Sheet

This laboratory report covers an experiment on the 8086 microprocessor. The objectives are to work with advanced 8086 instructions and learn how to write assembly programs using 8086 instructions and arrays. The report describes the internal architecture of the 8086, including its registers and pin diagram. It discusses the general purpose registers (AX, BX, CX, DX, SI, DI, BP, SP), segment registers (CS, DS, ES, SS), and special purpose registers (IP and flags register) of the 8086 microprocessor. The theory and methodology section provides details on the functions and usage of these registers.

Uploaded by

Arif Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

AMERICAN INTERNATIONAL UNIVERSITY BANGLADESH

Faculty of Engineering
Laboratory Report Cover Sheet
Students must complete all details except the faculty use part.

Please submit all reports to your subject supervisor or the office of the concerned faculty.

Laboratory Title: Introduction to Microprocessor 8086, 8086 instructions and programming


with 8086
Experiment Number: 01 Due Date: 10/08/2020 Semester: Summer 2019-2020
Subject Name: MICROPROCESSOR AND EMBEDDED SYSTEMS Section: C
Course Instructor: NADIA NOWSHIN Degree Program: EEE

Declaration and Statement of Authorship:

1. I/we hold a copy of this report, which can be produced if the original is lost/ damaged.
2. This report is my/our original work and no part of it has been copied from any other student’s work or from any other
source except where due acknowledgement is made.
3. No part of this report has been written for me/us by any other person except where such collaboration has been
authorized by the lecturer/teacher concerned and is clearly acknowledged in the report.
I/we understand that
7. Plagiarism is the presentation of the work, idea or creation of another person as though it is your own. It is a form of
cheating and is a very serious academic offence that may lead to expulsion from the University. Plagiarized material
can be drawn from, and presented in, written, graphic and visual form, including electronic data, and oral
presentations. Plagiarism occurs when the origin of the material used is not appropriately cited.
8. Enabling plagiarism is the act of assisting or allowing another person to plagiarize or to copy your work

Group Number (if applicable): Individual Submission Group Submission

No. Student Name ID Roll Department


Submitted by:
1 DIPONKAR CHANDRA KAR 17-34108-1 43 EEE
Group Members:
2 MEHEDI HASAN 18-36633-1 19 EEE
3 TANVIR MAHTAB RAFAT 17-34652-2 45 CSE

4 JABED ALI 18-36808-1 20 EEE

5 S.A.AREFIN ANNAN 18-36291-1 11 CSE


CSE
6 MARIA CHOWDHURY MUNA 18-38448-2 38
7 SAGOR DASH 18-37411-1 30 CoE
8 MD.ABDULLAH AL MOBIN 18-36869-1 22 CSE

For faculty use only: Total Marks: _______ Marks Obtained:


_______
Title: Introduction to Microprocessor 8086, 8086 instructions and programming with 8086.

Abstract:
The main purpose of this experiment is to studied about the working principle of MTS-86c& MDA 8086
and familiarize emulator EMU8086 by using a simple program to test its different uses and introduction to
segmented memory technology used by Microprocessor 8086.

Introduction:
8086 Microprocessor is an enhanced version of 8085Microprocessor that was designed by Intel in 1976.
The microprocessor 8086 can be considered to be the basic processor for the Intel X-86 family. With the
knowledge of this 16-bit processor, one can study the further versions of this processor 80386, 80406 and
Pentium. It is a 16-bit Microprocessor having 20 address lines and16 data lines that provides up to 1MB
storage. It consists of powerful instruction set, which provides operations like multiplication and division
easily. A Microprocessor is an Integrated Circuit with all the functions of a CPU however, it cannot be
used stan alone since unlike a microcontroller it has no memory or peripherals.8086 does not have a RAM
or ROM inside it. However, it has internal registers for storing intermediate and final results and interfaces
with memory located outside it through the System BEus.It consists of a powerful instruction set, which
provides operation like division and multiplication very quickly.The micro-kit we are using is “MTS-86c”
and “MDA 8086”. In 8086 there are many instructions. In this laboratory some instructions and mainly use
of arrays will be observed. In this experiment the main objective is:
1) To work with advanced 8086 instructions.
2) To learn how to write assembly programs using 8086 instructions and arrays.

Theory and Methodology:


The 8086 Microprocessor
The 8086 is a 16-bit microprocessor chip designed by Intel between early 1976 and mid-1978, when it was
released. The 8086 became the basic x86- architecture of Intel's future processors

Figure: Intel 8086 internal architecture


GND
AD14
AD13 A16,S3
AD12 A17,S4
AD11 A18,S5
AD10 A19,S6
AD9 /BHE,S7
AD8
AD7
AD6
8086
AD5
AD4
AD3
AD2
AD1
AD0 QS0

NMI QS1

INTR
CLK READY

GND

Figure: Internal Diagram, Registers and PIN diagram of the 8086 microprocessor

General Purpose Registers

8086 CPU has 8 general purpose registers; each register has its own name:

AX - the accumulator register (divided into AH / AL)

1. Generates shortest machine code

2. Arithmetic, logic and data transfer

3. One number must be in AL or AX

4. Multiplication & Division

5. Input & Output

BX - the base address register (divided into BH / BL).

CX - the count register (divided into CH / CL):

1. Iterative code segments using the LOOP instruction

2. Repetitive operations on strings with the REP command

3. Count (in CL) of bits to shift and rotate

DX - the data register (divided into DH / DL):


1. DX:AX concatenated into 32-bit register for some MUL and DIV

operations

2. Specifying ports in some IN and OUT operations

SI - source index register:

1. Can be used for pointer addressing of data

2. Used as source in some string processing instructions

3. Offset address relative to DS

DI - destination index register:

1. Can be used for pointer addressing of data

2. Used as destination in some string processing instructions

3. Offset address relative to ES

BP - base pointer:

1. Primarily used to access parameters passed via the stack

2. Offset address relative to SS

SP - stack pointer:

1. Always points to top item on the stack

2. Offset address relative to SS

3. Always points to word (byte at even address)

4. An empty stack will have SP = FFFEh

Segment Registers

CS - points at the segment containing the current program.

DS - generally points at segment where variables are defined.

ES - extra segment register, it's up to a coder to define its usage.

SS - points at the segment containing the stack.


Although it is possible to store any data in the segment registers, this is never a good idea. The
segment registers have a very special purpose - pointing at accessible blocks of memory.

Segment registers work together with general purpose register to access any memory value. For
example if we would like to access memory at the physical address 12345h(hexadecimal), we
could set the DS = 1230h and SI = 0045h. This way we can access much more memory than with
a single register, which is limited.
The CPU makes a calculation of the physical address by multiplying the segment register by 10h
and adding the general purpose register to it (1230h * 10h + 45h = 12345h):

The address formed with 2 registers is called an effective address.

By default, BX, SI and DI registers work with DS segment register; BP and SP work with
SS segment register. Other general-purpose registers cannot form an effective address. Also,
although BX can form an effective address, BH and BL cannot.

Special Purpose Registers


IP - the instruction pointer:

1. Always points to next instruction to be executed


2. Offset address relative to CS
IP register always works together with CS segment register and it points to currently executing
instruction.

Flags Register
Flags Register - determines the current state of the processor. They are modified automatically by
CPU after mathematical operations, this allows to determine the type of the result, and to determine
conditions to transfer control to other parts of the program. Generally, you cannot access these
registers directly.
1. Carry Flag (CF) - this flag is set to 1 when there is an unsigned overflow. For example,
when you add bytes 255 + 1 (result is not in range 0...255). When there is no overflow this
flag is set to 0.
2. Parity Flag (PF) - this flag is set to 1 when there is even number of ‘1’ bits in result, and to
0 when there is odd number of ‘1’ bits.
3. Auxiliary Flag (AF) - set to 1 when there is an unsigned overflow for low nibble (4 bits).
4. Zero Flag (ZF) - set to 1 when result is zero. For non-zero result this flag is set to 0.
5. Sign Flag (SF) - set to 1 when result is negative. When result is positive it is set to0. (This
flag takes the value of the most significant bit.)
6. Trap Flag (TF) - Used for on-chip debugging.
7. Interrupt enable Flag (IF) - when this flag is set to 1 CPU reacts to interrupts from external
devices.
8. Direction Flag (DF) - this flag is used by some instructions to process data chains, when
this flag is set to 0 - the processing is done forward, when this flag is set to 1the processing
is done backward.
9. Overflow Flag (OF) - set to 1 when there is a signed overflow. For example, when you add
bytes 100 + 50 (result is not in range -128...127).
8086 Segmented Memory

Microprocessor 8086 consists of 9 address registers CS, DS, SS, ES, SI, DI, SP, BP, IP. Address
registers store address of instruction and data in memory. These values are used by the processor
to access memory locations.8086 assigns a 20-bit physical address to its memory locations. Thus,
it is possible to address 220 = 1 megabyte of memory.

Segmented memory is the direct consequence of using 20-bit address in a 16-bit processor. The
address is too big to fit in a 16 bit register or memory word. The 8086 gets around this problem by
portioning its memory into segments.
A memory segment is a block of 2^16 (64K) consecutive memory bytes. Each segment is defined
by a segment number. A segment number is 16 bits, so the highest segment number is FFFFh.

Within a segment, a memory location is specified by giving an offset. The offset is the number of
byte beginning from the segment. With a 64KB segment, the offset can be given as a 16-bit
number. The first byte in a segment has offset 0. The last offset in a segment is FFFFh.

A memory location may be specified by providing a segment number and an offset, written in the
form segment: offset.This is known as logical address. For example, 1234: FF67 means offset
number FF67 of segment 1234. The 20-bit physical address can be calculated by multiplying the
segment number with 10h and then adding the offset with the result. For example, the physical
address for A4FB:4872 is
A4FB0
+4872
A9882
There are several advantages of working with the segmented memory. First of all, after initializing
the 16-bit segment registers, the 8086 has to deal with only 16-bit effective addresses. That is 8086
has to store and manipulate only 16-bit address components as both segment and offset are 16 bits.

Equipment:
1) EMU8086 [ver.408 (32 bit WINOS compatible)]
2) PC having Intel Microprocessor

Result:

Addition
Subtraction

Multiplication:
Division:

Discussion:

For Covid-19 we can’t do it laboratory.We did it online class. But our main focus would be to teach the basic
idea about assembly language by the help of emulator and 8086 board. In emulator we did addition, subtraction,
multiplication and division. In addition, we add AX, BX and the result of AX, BX is replaced by AX and in
subtraction, we subtract BX, CX and the result of BX, CX is replaced by BX. In multiplication, we multiply DL
is AX=AL*DL and the result of it is replaced by AX. In division, we divide
DL is AX=AX*DL and the result is replaced in AX. There were some difficulties to doing emu8086 software
but the experiment was successful in complying with the goal that was initially set.

References:

1. “Microprocessors and Micro-Computer based System Design”, Second edition – by Dr.


M. Rafiquzzaman.

2. EMU8086 Manual

You might also like