Advertisement
Shakken

Untitled

Jan 4th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. .model small
  2. .stack 100h
  3. .data
  4. num1 dw 1234h, 5678h
  5. num2 dw 8765h, 4321h
  6. res1 dw 0,0
  7. res2 dw 0,0
  8. .code
  9. start:
  10. mov ax, @data
  11. mov ds, ax
  12.  
  13. ; сложение
  14.  
  15. mov ax, num1[0]
  16. add ax, num2[0]
  17.  
  18. mov res1[0], ax
  19. mov ax, num1[2]
  20. adc ax, num2[2]
  21.  
  22. mov res1[2], ax
  23.  
  24. ; вычитание
  25.  
  26. mov ax, num1[0]
  27. sub ax, num2[0]
  28.  
  29. mov res2[0], ax
  30. mov ax, num1[2]
  31. sbb ax, num2[2]
  32.  
  33. mov res2[2], ax
  34.  
  35. mov ax, 4C00h
  36. int 21h
  37.  
  38. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement