Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. include 'emu8086.inc'
  2.  
  3. org 100h
  4.  
  5. gotoxy 13,1
  6. print 'This program performs the arithmetic operation below:', 0
  7. gotoxy 27,3
  8. print '(A + B) * (C - D) + E', 0
  9.  
  10. gotoxy 35, 5
  11. print 'A = ', 0
  12. gotoxy 39, 5
  13. call scan_num
  14. mov n1, cx
  15.  
  16. gotoxy 35, 6
  17. print 'B = ', 0
  18. gotoxy 39, 6
  19. call scan_num
  20. add cx, n1
  21. mov n1, cx
  22.  
  23. gotoxy 35, 7
  24. print 'C = ', 0
  25. gotoxy 39, 7
  26. call scan_num
  27. mov n2, cx
  28.  
  29. gotoxy 35, 8
  30. print 'D = ', 0
  31. gotoxy 39, 8
  32. call scan_num
  33. sub n2, cx
  34.  
  35. mov ax, n1
  36. mul n2
  37.  
  38. gotoxy 35, 9
  39. print 'E = ', 0
  40. gotoxy 39, 9
  41. call scan_num
  42. add ax, cx
  43.  
  44. gotoxy 15, 11
  45. print 'The result is: ', 0
  46. gotoxy 30, 11
  47. call print_num
  48.  
  49. int 20h
  50.  
  51. n1 dw ?
  52. n2 dw ?
  53. define_print_num
  54. define_print_num_uns
  55. define_scan_num
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement