0% found this document useful (0 votes)
103 views

Microprocessor and Get The Result in Hexadecimal

The document describes 8 assembly language programs written for the 8085 microprocessor. Program 1 adds two 8-bit numbers and displays the result in hexadecimal. Program 2 subtracts two 8-bit numbers and displays the result in hexadecimal. Program 3 adds two 16-bit numbers. Program 4 adds N 8-bit numbers. Program 5 separates a byte into its two nibbles and recombines two nibbles into a byte. Program 6 multiplies two 8-bit numbers using shift and add method. Programs 7(i) and 7(ii) arrange an array of N numbers in ascending and descending order respectively.

Uploaded by

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

Microprocessor and Get The Result in Hexadecimal

The document describes 8 assembly language programs written for the 8085 microprocessor. Program 1 adds two 8-bit numbers and displays the result in hexadecimal. Program 2 subtracts two 8-bit numbers and displays the result in hexadecimal. Program 3 adds two 16-bit numbers. Program 4 adds N 8-bit numbers. Program 5 separates a byte into its two nibbles and recombines two nibbles into a byte. Program 6 multiplies two 8-bit numbers using shift and add method. Programs 7(i) and 7(ii) arrange an array of N numbers in ascending and descending order respectively.

Uploaded by

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

Experiment No.

5 (a)

Aim: To perform (i) addition and (ii) subtraction of two 8 bit numbers using 8085
microprocessor and get the result in hexadecimal.

Apparatus Used: ET- 8085AD1, Qwerty Keyboard

Program:

START LXI H, 3000

MOV A, M
INX H

MOV B, M
ADD B
INX H

MOV M, A

RST 5

END END

OBSERVATION:

INPUT DATA: 3000 07H


3001 05H
OUTPUT DATA: 3002 0CH

RESULT: Thus the program to add two 8 Bit numbers was executed.

34
35
Experiment No. 5 (b)

Aim: To perform (i) addition and (ii subtraction of two 8 bit numbers using 8085
microprocessor and get the result in hexadecimal.

Apparatus Used: ET- 8085AD1 8 bits Microprocessor kit, Qwerty


Keyboard
Program:

START LXI H, 3000

MOV A, M
INX H

MOV B, M
SUB B
INX H

MOV M, A

RST 5

END END

OBSERVATION:

INPUT DATA: 3000 10H


3001 03H
OUTPUT DATA: 3002 0DH

RESULT: Thus the program to subtract two 8 Bit numbers executed.


36
Experiment No. 6

Aim: To perform addition of two 16 bit numbers using


8085microprocessor.

Apparatus Used: 8085AD1 8 bits Microprocessor kit, Qwerty Keyboard

Program:

START LHLD 3000

XCHG

LHLD 3002

MVI C, 00

DAD D
JNC 200E
INR C
SHLD 3004

MOV A,C

STA 3006
RST 5
END END

OBSERVATION :

INPUT: 3000 11 H
3001 55 H
3002 1A H
3003 1C H
OUTPUT: 3004 2B H
3005 81 H
3006 00 H

RESULT: Thus the program to add two 16 Bit numbers was executed.
37
Experiment No. 7

Aim: Write an assembly language program for addition of N 8 Bit


numbers.
Apparatus Used: 8085AD1 8 bits Microprocessor kit, Qwerty Keyboard

Program:

START LXI H, 3000

MOV B, M
XRA A
Loop Start INX H

ADD M
DCR B
Loop End JNZ 2005

STA 3050
5
END

OBSERVATION

INPUT DATA: 3000 0 4 H


3001 03 H
3002 04 H
3003 01 H
3004 02 H
OUTPUT DATA: 3050 0A H

RESULT: Thus the program to add N 8 - Bit numbers was executed.


38
Experiment No. 8(i)

Aim: Write an assembly language program to


(i) Separate a byte into two nibbles and
(ii) Combine two nibbles to form a byte

Apparatus Used: 8085AD1 8 bits Microprocessor kit, Qwerty Keyboard

Program:
START LDA 2200
MOV B,A

ANI 0F

STA 3000
MOV A,B
ANI F0

RRC
RRC
RRC
RRC
STA 3001
RST 5
END

OBSERVATION:

INPUT DATA: 2200H A7 H

OUTPUT DATA 3000 07 H


3001 0A H

RESULT: Thus the program to separate a byte into two nibbles was executed.
39
Experiment No. 8(ii)

Aim: Write an assembly language program to


(i) Separate a byte into two nibbles and
(ii) Combine two nibbles to form a byte
(iii)
Apparatus Used: 8085AD1 8 bits Microprocessor kit, Qwerty Keyboard

Program:

START LXI H, 3000


MOV A, M

RLC
RLC
RLC
RLC
INX H

ORA A
STA 3050
RST 5
END END

OBSERVATION:

INPUT DATA: 3000H 04 H


3001 H 02 H
OUTPUT DATA: 3050 24 H

RESULT: Thus the program to combine two nibbles to form a byte was executed.

39
40
Experiment No. 9

Aim: Write a program to multiply two 8 bit numbers using shift and add
method.

Apparatus Used: 8085AD1 8 bits Microprocessor kit, Qwerty Keyboard

Program:
START LHLD 3000

XCHG

MLTPLY MOV A, D

MVI D, 00H

LXI H, 0000H
MVI B, 08H

NXTBIT RAR
JNC NOADD

DAD D

NOADD XCHG
DAD H
XCHG

DCR B

JNZ NXTBIT
SHLD 3500

RST 5
END END

OBSERVATION:

INPUT DATA: 3000H 06H


3001H 04 H
OUTPUT DATA: 3500 H 00 H
3501 H 18 H

RESULT: Thus the program to arrange N numbers of arrays in ascending order has been
performed.
41
Experiment No. 10(i)

Aim: Write a program to arrange an array of n numbers in ascending/descending order.

Apparatus Used: 8085AD1 8 bits Microprocessor kit, Qwerty Keyboard

Program:
START LXI H, 2500
MOV C, M

BACK LXI H, 2500


MOV D, M
INX H
MOV A, M

LOOP INX H
MOV B, M
CMP B
JNC AHEAD
DCX H
MOV M, A
MOV A, B
JMP GO
AHEAD DCX H
MOV M, B

GO INX H
DCR D
JNZ LOOP
MOV M, A
DCR C
JNZ BACK
RST 5
END END

OBSERVATION:
INPUT DATA: 2500H 04H
2501 H 90H
2502 H 41 H
2503 H 20 H
2504 H 15 H
2505h -- 35H
OUTPUT DATA: 2501 H 15H
2502 H 20 H
2503 H 35 H
2504 H 41 H
2505h -- 90H

RESULT: Thus the program to arrange N numbers of arrays in ascending order has been
perform.
42
Experiment No. 10(ii)

Aim: Write a program to arrange an array of n numbers in ascending/descending order.

Apparatus Used: 8085AD1 8 bits Microprocessor kit, Qwerty Keyboard

Program:
START LXI H, 2500
MOV C, M
BACK LXI H, 2500
MOV D, M
INX H
MOV A, M

LOOP INX H
MOV B, M
CMP B
JC AHEAD
DCX H
MOV M, A
MOV A, B
JMP GO
AHEAD DCX H
MOV M, B

GO INX H
DCR D
JNZ LOOP
MOV M, A
DCR C
JNZ BACK
RST 5

END END

OBSERVATION:
INPUT DATA: 2500H Count (04H)
2501 H 90H
2502 H 41 H
2503 H 20 H
2504 H 15 H
2505h -- 35H
OUTPUT DATA:
2501 H 90H
2502 H 41 H
2503 H 35 H
2504 H 20 H
2505h -- 15H

RESULT: Thus the program to arrange N numbers of arrays in descending order has been
performed.
43
Experiment No. 11

Aim: Write an assembly language program to convert BCD to BINARY

Apparatus Used: 8085AD1 8 bits Microprocessor kit, Qwerty Keyboard

Program:
START LXI H, 3000
MOV A, M
MOV B, A
ANI 0FH
MOV C, A
MOV A, B
ANI FOH
RRC
RRC
RRC
RRC
MOV D, A
XRA A
MVI E, 0AH
SUM ADD E
DCR D
JNZ SUM
ADD C
STA 3500
END END

OBSERVATION:

INPUT DATA: 3000H 44H


OUTPUT DATA: 3500 H 2CH

RESULT: Thus the program to convert a BCD number to Binary Number executed
44
Experiment No. 12

Aim: Write an assembly language program to convert BINARY TO BCD

Apparatus Used: 8085AD1 8 bits Microprocessor kit, Qwerty Keyboard

Program:
START LXI SP, 2200
LXI H, 3000

MOV A, M
LXI H, 3500

MVI B, 64H
CALL BINBCD
MVI B, 0AH
CALL BINBCD
MOV M, A
RST 5
END END
SUBROUTINE
BINBCD MVI M, FFH
NXTBUF INR M

SUB B

JNC NXTBUF

ADD B

INX H
RET
END END

OBSERVATION:
INPUT DATA: 3000H 30 H
OUTPUT DATA: 3500 H 00 H
3501 H 04 H
3502 H 08 H

RESULT: Thus the program to convert a Binary Number to BCD Number executed.
45
Experiment No. 13(i)

Aim: Write an assembly language program for


(i) BCD addition
(ii) BCD subtraction
(iii)
Apparatus Used: 8085AD1 8 bits Microprocessor kit, Qwerty Keyboard

Program:

START MVI A, 20H

MVI B, 15H

ADD B

DAA
STA 3000
RST 5
END END

OBSERVATION:

INPUT DATA: 2001 H 20 H


2002 H 15 H
OUTPUT DATA: 3000 H 35 H

RESULT: BCD addition is executed on 8085.


46
Experiment No. 13(ii)

Aim: Write an assembly language program for


(i) BCD addition
(ii) BCD subtraction
(iii)
Apparatus Used: 8085AD1 8 bits Microprocessor kit, Qwerty Keyboard

Program:
START MVI B, 20H

MVI C, 15H

MVI A, 99H
SUB C

INR A

ADD B

DAA
STA 3000
RST 5
END END

OBSERVATION:

INPUT DATA: 2001 H 10 H


2002 H 05 H
OUTPUT DATA: 3000 H 05 H

RESULT: BCD subtraction is executed on 8085.


MICROPROCESSOR
LAB MANUAL

ARYAN MITTAL
2K14/EC/046

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