Home » 
        Embedded Systems
    
    Find the maximum of two 8-bit numbers | 8086 Microprocessor
    
    
    
    
        In this tutorial, we will learn how to find the maximum of two 8-bit numbers using 8086 Microprocessor?
        
            By Raju Singh Bhati Last updated : May 22, 2023
        
    
        
    Problem Statement
    To find maximum of two 8-bit numbers using 8086 Microprocessor.
    
    Algorithm
    
        - Move the first number to register AL.
- Move the second number to register BL.
- Compare the content of register AL and BL if not carry goto step 5 otherwise goto step 4.
- Move the content of register BL to the register AL.
- Move the content of register AL to the memory location.
Program
MOV     AL, [0600]
MOV     BL, [0601]
CMP     AL, BL
JNC **
MOV     AL, BL
** MOV [0602], AL
HLT
    Observation
INPUT: 
0600: 12
0601: 21
OUTPUT: 
0602: 21
    Hence successfully find the maximum of two 8-bit numbers using 8086 Microprocessor.
	
    
    
    
    
    
    
  
    Advertisement
    
    
    
  
  
    Advertisement