0% found this document useful (0 votes)
10 views27 pages

Microprocessor and Interfacing

Uploaded by

Subroto Bhowmik
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)
10 views27 pages

Microprocessor and Interfacing

Uploaded by

Subroto Bhowmik
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/ 27

Microprocessor and Interfacing

Submitted in complete fulfillment of the


requirements

FOR THE AWARD OF DEGREE OF


BACHELOR OF TECHNOLOGY
in
ENGINEERING PHYSICS
SUBMITTED BY:
Shreyansh Thakur(2k21/EP/92)
SUBMITTED TO: Dr. Anukul Pandey

1 Shreyansh Thakur
2k21/EP/92
Index

S.No. Experiment Name Date Signature Remarks


1 Introduction about the Intel
8086 Microprocessor and its
various components

2 Write a program in Assembly


language to:-
● Add two 8-bit Numbers with and
without a carry
● Add two 16-bit Numbers with
and without a carry
● Subtract two 8-bit Numbers with
and without a borrow
● Subtract two 16-bit Numbers
with and without a borrow

3 Write a program in Assembly


language to:-
● Multiply two 16-bit numbers
● Divide a 32-Bit number by a
16-bit number

4 Write a program in Assembly


language to perform Logic
Operations AND, OR, XOR, NOT,
NOR

5 Write a program in Assembly


language to:-
● Perform summation of even
numbers in a series
● Perform summation of odd
numbers in a series
● Find average

2 Shreyansh Thakur
2k21/EP/92
6. Write a program in Assembly
language to:-
● To find the minimum value in an
array
● To sort an array in ascending order

7. Write a program in Assembly


language to:-
1. Find the square root of a
given number
2. Convert the given binary
code to an equivalent
grey number

8. Write an Assembly language


program to convert a given
Decimal Number into the
equivalent Hexadecimal
number

3 Shreyansh Thakur
2k21/EP/92
Experiment-1

Aim- Introduction about the Intel 8086 Microprocessor and its various
components

Theory-
The pin diagram of the 8086 microprocessor looks something like this,

Intel 8086 microprocessor has a 16-bit ALU, 16-bit registers, internal data
bus, and 16-bit external data bus resulting in faster processing.
The registers in the 8086 microprocessor are divided into 4 main categories,
i.e,
1. General Purpose registers
2. Index registers
3. Status & Control registers
4. Segment registers

4 Shreyansh Thakur
2k21/EP/92
The general purpose of the data registers is described as follows,

There are three Control flags in 8086, namely, TF(Trap flag), IF(Interrupt
Flag), DF(Direction Flag)
There are four segment registers, namely, CS, DS, ES, and SS—standing for
code segment register, data segment register, extra segment register, and
stack segment register respectively. When a particular memory is being read
or written into, the corresponding memory address is determined by the
content of one of these four segment registers in conjunction with their
offset addresses. The contents of these registers can be changed so that the
program may jump from one active code segment to another one. The use
of these segment registers will be more apparent in memory segmentation
schemes.

References-
● chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://www.bbau.ac.in/dept/UIET/Co
mputer%20Engineering%20II%20Year.pdf
● chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://www.shahucollegelatur.org.in/D
epartment/Studymaterial/sci/compsci/intelarchitecture.pdf

5 Shreyansh Thakur
2k21/EP/92
Experiment-2
Aim- Write a program in Assembly language to:-
1. Add two 8-bit Numbers with and without a carry
2. Add two 16-bit Numbers with and without a carry
3. Subtract two 8-bit Numbers with and without a borrow
4. Subtract two 16-bit Numbers with and without a borrow
Tools used:- emu8086 assembler and microprocessor emulator
Introduction:-
The 8086 Microprocessor is an enhanced version of the 8085
Microprocessor that Intel designed in 1976. It is a 16-bit Microprocessor
having 20 address lines and 16 data lines that provide up to 1MB of storage.
It consists of a powerful instruction set, which provides operations like
multiplication and division easily. We use the 8086 emulator to add and
subtract 8-bit and 16-bit numbers respectively.
Code:-
1. Addition:-
8-Bit:
mov al,[1000h]
mov bl,[1001h]
mov cl,00h
add al,bl

mov [1007h],al
jnc carry1
inc cl
carry1:
6 Shreyansh Thakur
2k21/EP/92
mov [1009h],cl
hlt
With carry:-

Input- (88)+(99)
Output-(21) + Cf=1
Without carry:

7 Shreyansh Thakur
2k21/EP/92
Input- (22)+(11)
Output- (33) + Cf=0

16-Bit:
mov ax,[1000h]
mov bx,[1002h]
mov cl,00h
add ax,bx
mov [1012h],ax
jnc carry2
inc cl

8 Shreyansh Thakur
2k21/EP/92
carry2:
mov [1009h],cl
hlt
With carry:

Input- (F389)+(9EC5)
Output- (924E) + Cf=1

Without carry:

9 Shreyansh Thakur
2k21/EP/92
Input- (3311)+(4422)
Output- (7733) + Cf=0

2. Subtraction:-
We subtract using the 2’s complement subtraction method
16-Bit:
mov ax,[1000h]
mov bx,[1002h]
mov cl,00h
sub ax,bx

10 Shreyansh Thakur
2k21/EP/92
jnc shr
inc cl
not ax
add ax,0001h
shr:
mov [1008h],ax
mov [1012h],cl
hlt
Without borrow:-

11 Shreyansh Thakur
2k21/EP/92
Input-(89F5)-(2381)
Output- (6674)
With borrow:-

Input- (33F5)-(99F7)
Output- (6602) & IF=1
Conclusion-
We can see that when we perform addition and/or subtraction operations,
the carry/borrow is indicated by the carry/borrow flag and the result gets
stored in the desired memory locations.

12 Shreyansh Thakur
2k21/EP/92
Experiment-3
Aim- Write a program in Assembly language to:-
1. Multiply two 16-bit numbers
2. Divide a 32-Bit number by a 16-bit number
Tools used:- emu8086 assembler and microprocessor emulator
Introduction:-
The 8086 Microprocessor is an enhanced version of the 8085
Microprocessor that Intel designed in 1976. It is a 16-bit Microprocessor
having 20 address lines and 16 data lines that provide up to 1MB of storage.
It consists of a powerful instruction set, which provides operations like
multiplication and division easily. We use the 8086 emulator to multiply and
divide 8-bit and 16-bit numbers respectively. Data is stored in the General
purpose registers and commands Mul and Div are used
Code:-
Multiplication:-
mov ax, [1600h]
mov bx, [1602h]
mul bx
mov [1606h],ax
mov [1608h],dx
Hlt
Conclusion- Multiplication of two 8-bit or 16-bit numbers gives the
desired result at the allocated memory location using the 8-86
emulator.

13 Shreyansh Thakur
2k21/EP/92
Input- (9FF2)*(995E)
Output- (5CD2)

14 Shreyansh Thakur
2k21/EP/92
Input- (99FF)*(88FF)
Output- (5268)

15 Shreyansh Thakur
2k21/EP/92
Experiment-4
Aim- Write a program in Assembly language to perform logic operations
AND, OR, XOR, NOT on 16-bit numbers
Tools used:- emu8086 assembler and microprocessor emulator
Introduction:-
The 8086 Microprocessor is an enhanced version of the 8085
Microprocessor that Intel designed in 1976. It is a 16-bit Microprocessor
having 20 address lines and 16 data lines that provide up to 1MB of storage.
It consists of a robust instruction set, which offers operations like
multiplication and division easily. We use the 8086 emulators to multiply and
divide 8-bit and 16-bit numbers respectively. Logical Operations are a vital
part of the 8086 instruction set and are used in a plethora of operations and
programs. They utilize the General Purpose registers as well as the carry flag
among other components of the 8086 infrastructure.
Code:-
mov ax,[1000h]
mov bx,[1002h]
and ax,bx
mov [1004h],ax
mov cx,[1000h]
or cx,bx
mov [1006h],cx
mov dx,[1000h]
xor dx,bx
mov [1008h],dx
mov cx,[1002h]

16 Shreyansh Thakur
2k21/EP/92
not dx
not ax
hlt

Input- a=3458: b=7268


Output- All Logical operations are performed on a&b
Conclusion- We can successfully perform the various logic operations using
an 8086 microprocessor and the result gets stored in the desired memory
locations.

17 Shreyansh Thakur
2k21/EP/92
Experiment-5
Aim- Write an Assembly language program to:-
● Perform summation of even numbers in a series
● Perform summation of odd numbers in a series
● Find the average of all the numbers in the series

Tools used- emu8086 assembler and microprocessor emulator

Introduction- The 8086 Microprocessor is an enhanced version of the 8085


Microprocessor that Intel designed in 1976. It is a 16-bit Microprocessor
having 20 address lines and 16 data lines that provide up to 1MB of storage.
It consists of a robust instruction set, which offers operations like
multiplication and division easily. We use the 8086 emulators to Pick out
numbers in a series according to the given requirements.
Code:-
mov ax, 00h
mov cl, 0Ah
mov SI, 1100h

L2:
mov bh, [SI]
AND bh, 01h
JZ L1
add ah, [SI]
inc SI
Dec cl
JNZ L2
JZ L3

L1:
add al, [SI]
inc SI
Dec cl
18 Shreyansh Thakur
2k21/EP/92
JNZ L2
JZ L3

L3:
mov [1140h], ah
mov [1142h], al
add al, ah
mov bl, 0Ah
mov ah, 00h
div bl
mov [1148h], al
hlt

Input- 11,64, 80,FE,98,16,13,48,55,00


Output- Sum of odd placed- 79
Sum of even placed- D8
Average of series- 08
Carry flag-1
Conclusion: From the experiment, it can be concluded that the 8086
microprocessor is capable of operating and finding even and odd number,
and we can sum them up to find the average of all the given numbers. We
segregate Odd and Even numbers using the AND logical operator and the ZF
19 Shreyansh Thakur
2k21/EP/92
and then we use the jump function to iterate the whole process.

20 Shreyansh Thakur
2k21/EP/92
Experiment-6
Aim- Write an Assembly language program to:-
● To find the minimum value in an array
● To sort an array in ascending order

Tools used- emu8086 assembler and microprocessor emulator

Introduction- The 8086 Microprocessor is an enhanced version of the 8085


Microprocessor that Intel designed in 1976. It is a 16-bit Microprocessor
having 20 address lines and 16 data lines that provide up to 1MB of storage.
It consists of a robust instruction set, which offers operations like standard
arithmetic as well as logical operations quickly. We use the 8086 emulators
to arrange a given series of numbers in ascending order and therefore, find
out the minimum term of that particular series.
Code:-
To find the minimum value in the series
mov SI,1100h
mov di,1110h
mov cl,[SI]
mov ch,00
inc SI
mov al,[SI]
dec cl
B:
inc SI
mov bl,[SI]
cmp al,bl
JC A
mov al,bl
A:
Loop B
mov [di],al

21 Shreyansh Thakur
2k21/EP/92
hlt

Input- 54,78,02,15,89,31,68
Output- 02
To arrange the particular array in ascending order

mov si, 1100h


mov cl, [si]
dec cl
B:
mov si, 1100h
mov ch, [si]
dec ch
inc si
A:
mov al, [si]
inc si
cmp al,[si]
JC C
xchg al,[si]
dec si
xchg al,[si]
inc si
22 Shreyansh Thakur
2k21/EP/92
C:
dec ch
JNZ A
dec cl
JNZ B
hlt

Input- 01 ,42 ,04, 06, 87


Output- 01,04,06,42,87

Conclusion- From the experiment, we can see that 8086


microprocessor can be used to perform array operations. We use
the instruction set of the 8086 microprocessor to compare the
elements in a particular array and arrange them in ascending order.
After the array has been arranged in ascending order, we can single
out the very first term as the minimum term in the given array.

23 Shreyansh Thakur
2k21/EP/92
Experiment-7
Aim- Write an Assembly language program to:-
1. Find the square root of a given number
2. Convert the given binary code to equivalent grey number
Tools used- emu8086 assembler and microprocessor emulator

Introduction- The 8086 Microprocessor is an enhanced version of the 8085


Microprocessor that Intel designed in 1976. It is a 16-bit Microprocessor
having 20 address lines and 16 data lines that provide up to 1MB of storage.
It consists of a robust instruction set, which offers operations like standard
arithmetic as well as logical operations quickly. We use addition and
subtraction to place hold the pointer and find the square root of the given
number

Code-
1. Code to find out the square root of a given number
mov ax,[1000h]
mov cx, 0000h
mov bx, 0FFFh

A:
Add bx,02
inc cx
sub ax,bx
JNZ A
mov [1030h],cx
hlt

Input- 81
Output-09

24 Shreyansh Thakur
2k21/EP/92
2. Code to convert given binary number into grey code

MOV AL, [1100]; Load the number into AL


MOV BL, AL; Store AL to BL also
SHR AL, 01; Shift AL to right one time
XOR BL, AL; XOR AL and BL
MOV [1104], BL; Store BL into memory
HLT; Terminate the program

Conclusion- We Conclude that we can use the 8086 microprocessor and its
instruction set to find the square root of any given number assuming the
given number to be a perfect square. The instruction set of 8086
microprocessor also allows us to perform binary to grey code conversion.

25 Shreyansh Thakur
2k21/EP/92
Experiment-8
Aim- Write an Assembly language program to convert a given Decimal
Number into the equivalent Hexadecimal number
Tools used- emu8086 assembler and microprocessor emulator

Introduction- The 8086 Microprocessor is an enhanced version of the 8085


Microprocessor that Intel designed in 1976. It is a 16-bit Microprocessor
having 20 address lines and 16 data lines that provide up to 1MB of storage.
It consists of a robust instruction set, which offers operations like standard
arithmetic as well as logical operations quickly. We use simple arithmetic
and logical operations possible in the 8086 microprocessor

Code-
mov SI,1000H
mov DI,1010H
mov BL,[SI]
and BL,0FH
mov AL,[SI]
and AL,00F0H
mov CL,04H
ror AL,CL
mov DL,0AH
mul DL
add AL,BL
mov DL,AL
mov [DI],AL
hlt

26 Shreyansh Thakur
2k21/EP/92
Input-56
Output-38
Carry Flag-0
Conclusion- We conclude that we can efficiently perform the
conversion of a decimal number to its hexadecimal equivalent using
the tools offered to us by the 8086 microprocessor’s instruction-set.

27 Shreyansh Thakur
2k21/EP/92

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy