Home »
Embedded Systems
Find minimum of two 16-bit numbers | 8086 Microprocessor
In this tutorial, we will learn how to find minimum of two 16-bits numbers using 8086 Microprocessor?
By Akash Kumar Last updated : May 22, 2023
Problem Statement
To find minimum of two 16bit 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 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
JC **
MOV AX, BX
** MOV [0604], AX
HLT
Observation
INPUT:
0600 : 14
0601 : 12
0602 : 23
0603 : 11
OUTPUT:
0604 : 14
0605 : 12
Hence, we successfully find the minimum of two 16-bit numbers using 8086 Microprocessor.