SHARE
TWEET

Assemble Subtraction WITH MESSAGES

naeem043 Feb 14th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL
  2. .STACK 100H
  3. .DATA
  4.     MSG1 DB 10,13, 'ENTER THE FIRST NUMBER : $'  
  5.     MSG2 DB 10,13, 'ENTER THE SECOND NUMBER : $'
  6.     MSG3 DB 10,13, 'OUTPUT :$'      
  7.            
  8. .CODE
  9. MAIN PROC
  10.        
  11.     MOV AX, DATA
  12.     MOV DS, AX
  13.    
  14.     LEA DX, MSG1
  15.     MOV AH, 9
  16.     INT 21H
  17.    
  18.    
  19.     MOV AH, 1  
  20.     INT 21H             ;INPUT ONE
  21.     MOV BL, AL                      
  22.    
  23.     LEA DX, MSG2
  24.     MOV AH, 9
  25.     INT 21H
  26.        
  27.        
  28.     MOV AH, 1  
  29.     INT 21H             ;INPUT TWO
  30.     MOV CL, AL
  31.    
  32.     SUB BL,CL
  33.     ADD BL, 48 ;reduce when use big input as like 100 whose are greater than 9
  34.      
  35.    
  36.     LEA DX, MSG3
  37.     MOV AH, 9
  38.     INT 21H
  39.                  
  40.     MOV AH, 2
  41.     MOV DL, BL     ;OUTPUT
  42.     INT 21H
  43.    
  44. MAIN ENDP
  45. 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