SHARE
TWEET

Assemble MULTIPLICATION AND DIVISION(INCOMPLETE)

naeem043 Mar 29th, 2019 77 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.     A DW ?
  7.     B DW ?
  8.     C DW ?
  9.     D DW ?
  10.                
  11. .CODE
  12. MAIN PROC    
  13.     INCLUDE 'EMU8086.INC'
  14.    
  15.     DEFINE_SCAN_NUM  
  16.     DEFINE_PRINT_NUM
  17.     DEFINE_PRINT_NUM_UNS
  18.    
  19.    
  20.     MOV AX, @DATA
  21.     MOV DS, AX  
  22.    
  23.     PRINTN 'ENTER THE DIVISOR VALUE: '
  24.     CALL SCAN_NUM  
  25.     MOV D,CX
  26.    
  27.     PRINTN 'ENTER THE 1ST VALUE: '
  28.     CALL SCAN_NUM  
  29.     MOV A, CX        
  30.    
  31.    
  32.     PRINTN 'ENTER THE 2ND VALUE: '
  33.     CALL SCAN_NUM  
  34.     MOV B, CX
  35.          
  36.    
  37.     PRINTN 'ENTER THE 3RD VALUE: '
  38.     CALL SCAN_NUM    
  39.     MOV C, CX
  40.     MOV AX, CX
  41.     MUL A
  42.     MUL B
  43.     MUL C
  44.    
  45.      
  46.    
  47.     ;MOV C, AX
  48.  
  49.     DIV D         ; AX/BL AH = REMINDER; AL = QUOTIENT / RESULT
  50.    
  51.     MOV R, AH
  52.     MOV Q, AL
  53.    
  54.     PRINT 'THE QUOTIENT IS: '
  55.    
  56.     ;ADD Q, 48
  57.     MOV AH, 2
  58.     MOV DL, Q
  59.     INT 21H  
  60.                
  61.     PRINTN ''
  62.    
  63.     PRINT 'THE REMINDER IS: '
  64.     ;SUB R, 48
  65.     MOV DH, R
  66.     INT 21H
  67.  
  68.      
  69.     MOV AH, 4CH
  70.     INT 21H  
  71.    
  72. 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