Home »
Embedded Systems
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
- Move the first number to register AX.
- Move the second number to register BX.
- Compare the content of register AX and BX if no carry goto step 5 otherwise goto step 4.
- Move the content of register BX to the register AX.
- 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.