vidhan.docx

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Microprocessor and Interfacing

Submitted in complete fulfillment of the


requirements

FOR THE AWARD OF DEGREE OF


BACHELOR OF TECHNOLOGY
in
ENGINEERING PHYSICS
SUBMITTED BY:
Subroto Bhowmik (2K21/EP/9)
SUBMITTED TO: Dr. Anukul Pandey
Index

1. Introduction to 8086 microprocessor

2.
a. Add two 8-bit Numbers with and
without a carry
b. Add two 16-bit Numbers with and
without a carry
c. Subtract two 8-bit Numbers with and
without a borrow
d. Subtract two 16-bit Numbers with and
without a borrow
3.

a. Multiply two 16-bit numbers


b. 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 on 16-bit numbers
Experiment-2

AIM - Write a program to add a two 8 bit numbers


with and without carry

Theory-
The instruction is to load data from memory 1000 into
the AX register and data from memory 1002 into the
BX register. The value 00h is loaded into the CL
register as a carry flag. Then, BX is added to the
accumulator AX and a jump is performed based on
the carry result. If a carry is present, CL is
incremented by
1. Finally, the data in the CL register is moved to
memory address 1015 and the operation is stopped.
Code-
mov al,[1000h]
mov bl,[1001h]
mov cl,00h
add al,bl
mov [1007h],al
jnc shreyas
inc cl
shreyas:

mov [1009h],cl
hlt
With Carry-
Without carry-
AIM - Write a program to add a two 16 bit
numbers with and without carry

Theory-
8086 is 16-bit register. We can simply take the numbers
from memory to AX and BX register, then add them using
ADD instruction. When the Carry is present store carry into
memory, otherwise only store AX into memory.

Codes-
mov ax,[1000h]
mov bx,[1002h]
mov cl,00h
add ax,bx

mov
[1012h],ax Jnc
shreyas
inc cl

shreyas:
mov [1009h],cl
hlt
Without carry-
With carry-
Experiment -3

AIM - Multiply two 16-bit numbers


Theory-
8086 is 16-bit register.we can take two 16 bit numbers
in AX and BX. then multiply them using MUL
instruction . Then we need two registers to store
32-bit number ,so the result is stored in DX and AX.
Code-
;MULTIPLICATION OF TWO 16-BIT NUMBER
MOV AX,806AH
MOV BX,5D76H
MUL BX
AIM - Divide a 32-Bit number by a 16-bit number
Theory-
8086 is 16-bit register. To perform division in 8086 procesor,
the 32 bit dividend should be stored in AX and DX
register(lower part in AX and upper part in DX).the 16 bit
divisor can be stored in registor/memory.after division ,the
quotient will be in AX registerand the remainder will be in DX
register.
Code-
;dividing 32 bit by 16 bit
number MOV DX,2222H
MOV
AX,3333H
MOV BX,7777H
DIV BX
Experiment-4
Aim- Write a program in Assembly language to perform logic operations
AND, OR, XOR, NOT, NOR 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.
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]
not dx
not ax
Conclusion- Here we can successfully perform the various logic operations
using an 8086 microprocessor and the result gets stored in the desired
memory locations.

You might also like