SHARE
TWEET

Assemble Sum of digits of a number

naeem043 Mar 22nd, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL
  2. .STACK 100H
  3. .DATA
  4.     ARRAY DB '35'
  5.              
  6. .CODE
  7. MAIN PROC    
  8.     INCLUDE 'EMU8086.INC'  
  9.    
  10.     MOV AX, @DATA
  11.     MOV DS, AX
  12.    
  13.     MOV SI, 1
  14.     MOV CX, 2
  15.    
  16.     FOR:
  17.         ADD DX, [SI]
  18.        
  19.         DEC SI
  20.        
  21.     LOOP FOR      
  22.    
  23.     SUB DX, 48
  24.     MOV AH,2
  25.     INT 21H
  26.        
  27.     MOV AH, 4CH
  28.     INT 21H
  29.        
  30.    
  31. 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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top