Advertisement
naeem043

Assemble Sum of digits of a number

Mar 22nd, 2019
100
0
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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement