Home »
Embedded Systems
Minimum of Two 8-bit Numbers in 8085 Microprocessor
In this tutorial, we will learn how to find the minimum of two 8-bit numbers in 8085 Microprocessor?
By Akash Kumar Last updated : May 13, 2023
Minimum of Two 8-bit Numbers in 8085 Microprocessor
Given two 8-bit numbers, we have to find the minimum number among them in 8085 Microprocessor.
Algorithm
- Load the accumulator with the first data.
- Move the content of accumulator to register B.
- Load the accumulator with the second data.
- Compare the content of accumulator with the content of register B.
- If carry flag is set then jump to the step 7.
- Copy the content to accumulator.
- Now load the result value in memory location from accumulator.
Program
LDA 2050
MOV B, A
LDA 2051
CMP
JC **
MOV A, B
** STA 2052
Observation
INPUT:
2050:05
2051:02
OUTPUT:
2052:02
Hence, we successfully find the minimum among two 8 bits numbers.