Find maximum of two 16-bit numbers | 8086 Microprocessor

In this tutorial, we will learn how to find maximum of two 16-bit numbers using 8086 Microprocessor? By Akash Kumar Last updated : May 22, 2023

Problem Statement

To find maximum of two 16-bit numbers using 8086 Microprocessor.

Algorithm

  1. Move the first number to register AX.
  2. Move the second number to register BX.
  3. Compare the content of register AX and BX if no carry goto step 5 otherwise goto step 4.
  4. Move the content of register BX to the register AX.
  5. Move the content of register AX to the memory location.

Program

MOV     AX, [0600]
MOV     BX, [0602]
CMP     AX, BX
JNC **
MOV     AX, BX
** MOV [0604], AX
HLT

Observation

INPUT:
0600: 14
0601: 12
0602: 23
0603: 11

OUTPUT:
0604: 23
0605: 11

Hence, we successfully find the maximum of two 16 bit numbers using 8086 Microprocessor.




Comments and Discussions!

Load comments ↻





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