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

Lab 1 and Lab 2 - Microprocessor

This document describes two programs for an 8085 microprocessor. The first program performs 8-bit addition of two hexadecimal numbers using an accumulator. The second program multiplies two 8-bit hexadecimal numbers using registers and accumulation.

Uploaded by

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

Lab 1 and Lab 2 - Microprocessor

This document describes two programs for an 8085 microprocessor. The first program performs 8-bit addition of two hexadecimal numbers using an accumulator. The second program multiplies two 8-bit hexadecimal numbers using registers and accumulation.

Uploaded by

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

LAB – 1

8-BIT ADDITION

OBJECTIVE: To perform 8-bit Addition of two hexadecimal numbers using accumulator in


8085

PROGRAM:
Program Explanation

MVI A, 05 Load immediate data 05 into the accumulator

MVI B, 04 Load immediate data 05 register B

ADD B Add data in B to accumulator & store in the accumulator

STA C300 Store the (Result) contents of accumulator to address C300

HLT (RST 1) End of Program

MNEMONICS:
ADDRESS INSTRUCTIONS OPCODE

C000 MVI A, 05 3E

C001 05

C002 MVI B, 04 06

C003 04

C004 ADD B 80

C005 STA C300 32

C006 00

C007 C3

C008 RST 1 CF
INPUT & OUTPUT:
ADDRESS Values

C001 INPUT 1 05

C003 INPUT 2 04

C300 RESULT 09

ADDRESS Values

C001 INPUT 1 05

C003 INPUT 2 02

C300 RESULT 07

RESULT: The program for adding two 8-bit hexadecimal numbers using accumulator &
registers has been performed with different sets of data.

CALCULATION:
INPUT 1 = 05 = 0000 0101
INPUT 2 = 04 = 0000 0100
+ 09 = 0000 1000

INPUT 1 = 05 = 0000 0101


INPUT 2 = 02 = 0000 0010
+ 07 = 0000 0111

DISCUSSION AND CONCLUSION:


1. Instruction set used (Data transfer, Arithmetic, Logical, Branch, Program Control )
2. Instruction set used based on size (1 byte, 2 bytes, 3 bytes) and
3. Addressing mode used (Direct, Indirect, Implicit, Immediate)
4. Hence, the program for adding two 8 – bit numbers using accumulator and register has been
performed with different sets of data.
LAB – 2

8 BIT MULTIPLICATION
OBJECTIVE: To multiply two 8-bit hexadecimal numbers using 8085 microprocessor

PROGRAM:
Address/Label Program Explanation

LXI H, C201 Setting pointer for data

XRA A Set Accumulator to '0' to account for product

MOV B,M Move Data 1 to Register B from Memory

INX H Increment the memory pointer

MOV D,M Move Data 2 to Register D from Memory

Repeat ADD D Add contents of Register D to Accumulator

JNC Ahead If carry==0 , go Ahead

Ahead DCR B Decrement Register B content by 1

JNZ Repeat If B is not Zero, got back to Repeat

INX H Increment the memory pointer

MOV M,A Store Accumulator content (Product) to memory

INX H Increment the memory pointer

HTL(RST 1) End of program


MNEMONICS:
ADDRESS INSTRUCTIONS OPCODE

C000 LXI H, C201 21

C001 01

C002 82

C003 XRA A AF

C004 MOV B,M 46

C005 INX H 23

C006 MOV D,M 56

C007 ADD D 82

C008 JNC Ahead D2

C009 0E

C00A C0

C00B DCR B 05

C00C JNZ Repeat C2

C00D 09

C00E C0

C00F INX H 23

C010 MOV M, A 77

C011 INX H 23

C012 RST 1 CF
INPUT & OUTPUT:
C201 INPUT 1 5

C202 INPUT 2 3

C203 PRODUCT F

CALCULATION:
05 = 0000 0101

+ 05 = 0000 0101

= 0000 1010

+ 05 = 0000 0101

= 0F = 0000 1111

= 0F H

RESULT: The program to multiply two 8-bit hexadecimal numbers using 8085 was executed.

DISCUSSION AND CONCLUSION:


1. Instruction set used (Data transfer, Arithmetic, Logical, Branch, Program Control)
2. Instruction set used based on size (1 byte, 2 bytes, 3 bytes) and
3. Addressing mode used (Direct, Indirect, Implicit, Immediate)
4. Hence, the program for adding two 8 – bit numbers using accumulator and register has been
performed with different sets of data.

You might also like