al__nasim

FIRST_ASSEMBLY

Nov 23rd, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. .MODEL SMALL
  2. .STACK 100H
  3. .DATA
  4. A DW 2
  5. B DW 5
  6. SUM DW ?
  7. .CODE
  8. MAIN PROC
  9. ;initialize DS
  10. MOV AX,@DATA
  11. MOV DS,AX
  12. ;add the numbers
  13. MOV AX,A ;AX has A
  14. ADD AX,B ;AX has A+B
  15. MOV SUM,AX ;SUM=A+B
  16.  
  17. ;exit to DOS
  18. MOV AX,4C00H
  19. INT 21H
  20. MAIN ENDP
  21. END MAIN
Advertisement
Add Comment
Please, Sign In to add comment