Home »
Embedded Systems
Maximum of Two 8-bit Numbers in 8085 Microprocessor
In this tutorial, we will learn how to find the maximum of two 8-bit numbers in 8085 Microprocessor?
By Diksha Tewari Last updated : May 13, 2023
Maximum of Two 8-bit Numbers in 8085 Microprocessor
Given two 8-bit numbers, we have to find the maximum 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 reset 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
JNC **
MOV A, B
** STA 2052
Observation
INPUT:
2050:05
2051:02
OUTPUT:
2052:05
Hence, we successfully find the maximum among two 8 bits numbers.