SHARE
TWEET

Assemble DIVISION

naeem043 Mar 29th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL
  2. .STACK 100H
  3. .DATA
  4.     R DB 0
  5.     Q DB 0            
  6. .CODE
  7. MAIN PROC    
  8.     INCLUDE 'EMU8086.INC'
  9.    
  10.     MOV AX, @DATA
  11.     MOV DS, AX
  12.  
  13.     MOV AX, 007H
  14.     MOV BL, 2
  15.     DIV BL         ; AX/BL AH = REMINDER; AL = QUOTIENT / RESULT
  16.    
  17.     MOV R, AH
  18.     MOV Q, AL
  19.    
  20.     PRINT 'THE QUOTIENT IS: '
  21.    
  22.     ADD Q, 48
  23.     MOV AH, 2
  24.     MOV DL, Q
  25.     INT 21H  
  26.                
  27.     PRINTN ''
  28.    
  29.     PRINT 'THE REMINDER IS: '
  30.     SUB R, 48
  31.     MOV DH, R
  32.     INT 21H
  33.  
  34.      
  35.     MOV AH, 4CH
  36.     INT 21H  
  37.    
  38. 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