100% found this document useful (1 vote)
5K views2 pages

Subtraction Using 8085: Ex. No: 8-BIT Date: Aim

The document describes an assembly language program that subtracts two 8-bit numbers using the 8085 microprocessor. The algorithm loads the first number into register B, loads the second number into the accumulator register, subtracts the value in B from the accumulator, and stores the result. A flowchart and program are provided to get the first data into register B, second data into the accumulator, subtract the values, and store the result.

Uploaded by

Raja Patel
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
100% found this document useful (1 vote)
5K views2 pages

Subtraction Using 8085: Ex. No: 8-BIT Date: Aim

The document describes an assembly language program that subtracts two 8-bit numbers using the 8085 microprocessor. The algorithm loads the first number into register B, loads the second number into the accumulator register, subtracts the value in B from the accumulator, and stores the result. A flowchart and program are provided to get the first data into register B, second data into the accumulator, subtract the values, and store the result.

Uploaded by

Raja Patel
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/ 2

EX.

NO: 8-BIT SUBTRACTION USING 8085


DATE:

AIM:
To write an assembly language program for subtracting two eight bit numbers using 8085
processor.

APPARATUS REQUIRED:
 8085 Microprocessor kit,
 Power supply

ALGORITHM:
 Get data in Accumulator at specified memory location
 Store the data in B register
 Get next data in Accumulator register
 6.Add the contents of A register with B register
 Store the result
 Terminate the program

FLOW CHART:
Start

Get first data


in B reg

Get second data


in A reg

Subtract the
values

Store result

Stop
PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


4100 3A START: LDA, 4150H Load the contents of
4150H to HL register
4101 50
4102 41
4103 47 MOV B,A Transfer the data from
accumulator to B register
4104 3A LDA 4151 Load the contents of
4151H to the accumlator
4105 51
4106 41
4107 90 SUB B Subtract the contents of R
from the accumulator.
4108 32 STA 4152 Store the contents of
accumulator in 4152H
4109 52
410A 41
410B 76 STOP: HLT Terminate the program

MANUAL CALCULATION:

(A) : 70H = 0111 0000


(B) : 20H = 0010 0000 (-)

(A) : 50H = 0101 0000

ADDRESS DATA
Input:
4150H 70H
4151H 20H
Output:
4152H 50H

RESULT:

Subtraction of two 8-bit numbers using 8085 is performed and the output is verified.

You might also like