Home »
Embedded Systems
Subtract Two 8-bit Numbers without Borrow in 8085 Microprocessor
In this tutorial, we will learn how to subtract two 8-bit numbers without borrow in 8085 Microprocessor?
By Akash Kumar Last updated : May 13, 2023
Subtraction of Two 8-bit numbers without Consideration of Borrow in 8085 Microprocessor
Given two 8-bit numbers, we have to subtract them without borrow in 8085 Microprocessor.
Algorithm
- Load the accumulator with the first data.
- Move data of accumulator to register B.
- Load the second data into accumulator.
- Subtract the content of register B with the content of accumulator.
- Now load the result value in memory location.
Program
LDA 2050
MOV B,A
LDA 2051
SUB B
STA 2052
Observation
INPUT:
2050:02
2051:04
OUTPUT:
2052:02
Hence, we successfully subtracted two 8 bits numbers.