SHARE
TWEET

Assebly Compare 3 input

naeem043 Feb 21st, 2019 (edited) 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL
  2. .STACK 100H
  3.          
  4. .CODE
  5. MAIN PROC    
  6.     INCLUDE 'EMU8086.INC'
  7.  
  8.     PRINT 'ENTER THE FIRST NUMBER : '
  9.    
  10.    
  11.     MOV AH, 1  
  12.     INT 21H             ;INPUT ONE
  13.     MOV BH, AL                      
  14.    
  15.     PRINTN 'ENTER THE SECOND NUMBER : '
  16.        
  17.        
  18.     MOV AH, 1  
  19.     INT 21H             ;INPUT TWO
  20.     MOV BL, AL
  21.                
  22.     PRINTN 'ENTER THE THIRD NUMBER : '
  23.        
  24.     MOV AH, 1  
  25.     INT 21H             ;INPUT TWO
  26.     MOV CL, AL
  27.    
  28.                    
  29.     CMP BH,BL           ; COMPARE TWO INPUTS
  30.     ;ADD BL, 48 ;reduce when use big input as like 100 whose are greater than 9
  31.    
  32.     JGE LEVEL1
  33.     JLE LEVEL2
  34.    
  35.     LEVEL1:
  36.         CMP BH,CL
  37.         JGE LEVELA    
  38.        
  39.         JLE LEVELC
  40.      
  41.     LEVEL2:
  42.         CMP BL,CL
  43.         JGE LEVELB  
  44.  
  45.         JLE LEVELC
  46.          
  47.        
  48.    LEVELA:        
  49.        
  50.         PRINTN ' A IS THE LARGEST NUMBER'  
  51.        
  52.         JMP EXIT
  53.                  
  54.            
  55.    LEVELB:        
  56.        
  57.         PRINTN ' B IS THE LARGEST NUMBER'  
  58.        
  59.         JMP EXIT
  60.        
  61.        
  62.    LEVELC:        
  63.        
  64.         PRINTN ' C IS THE LARGEST NUMBER'  
  65.        
  66.         JMP EXIT
  67.                  
  68.            
  69.     EXIT:
  70.         MOV AH,4CH      ; EXIT FROM MAIN BODY
  71.         INT 21H    
  72.    
  73. MAIN ENDP
  74. END MAIN
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top