×

Embedded Systems Tutorial

AVR Microcontroller

8051 Microcontroller

8085 Microprocessor

8086 Microprocessor

8255 Microprocessor

Embedded Systems Practice

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

  1. Load the accumulator with the first data.
  2. Move the content of accumulator to register B.
  3. Load the accumulator with the second data.
  4. Compare the content of accumulator with the content of register B.
  5. If carry flag is reset then jump to the step 7.
  6. Copy the content to accumulator.
  7. 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.




Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.