SHARE
TWEET

Assembly Summation of n

naeem043 Apr 13th, 2019 12 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL
  2. .STACK 100H
  3. .CODE
  4. .DATA
  5.  
  6. B DB ?      
  7. NUM DW 50 DUP(?)
  8.  
  9.  
  10. MAIN PROC
  11.     INCLUDE 'EMU8086.INC'
  12.      DEFINE_SCAN_NUM
  13.      DEFINE_PRINT_NUM
  14.      DEFINE_PRINT_NUM_UNS  
  15.    
  16.     MOV AX,@DATA
  17.     MOV DS,AX
  18.    
  19.     MOV AX,0
  20.     PRINTN 'INPUT Nth NUMBER '
  21.     CALL SCAN_NUM
  22.     MOV DX,1
  23.     MOV DI,0  
  24.    
  25.    
  26.     INPUT:
  27.         MOV NUM[DI], DI    ;INSERT INTO ARRAY
  28.         INC DI
  29.         ADD BX, DI
  30.         CMP CX, DI
  31.         JNE INPUT  
  32.          
  33.        
  34.        
  35.       MOV AX, BX
  36.      CALL PRINT_NUM
  37.    
  38.  
  39.  
  40.     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