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:

  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

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL







Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.