Home »
Embedded Systems
Find maximum of two 16-bit numbers | 8086 Microprocessor
Here, we are going to learn how to find maximum of two 16-bit numbers using 8086 Microprocessor?
Submitted by Akash Kumar, on November 10, 2018
Problem: 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.