Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. org 100h
  2.  
  3. push 2000
  4. mov bx, b ;?????? ?????? ??????? ??????? ???????
  5. mov a, bx ;? ???????????(?? ?????? ????? ???????? ? 100% ???????)
  6. mov bx, 0 ;????????
  7. tostackb: ;?????? ? ???? ?????? ??????
  8. push b+bx ;?????? ??????? ????
  9. inc bx ;??????????? ?? 2
  10. inc bx ;?.? ??????? (a), (b), (c) - DW
  11. cmp bx, 22 ;?????????, ????? ?? ?? ????? ???????(18 - ??? ??????, 20 - ??? ??????, 22 - ??? ???)
  12. jb tostackb ;???? ???? 22- ?????????? ?????? ? ????
  13.  
  14. mov bx, 0 ;????? ????????
  15. tostackc:
  16. push c+bx ;??? ??-?? ?????, ?????? ?????? ??? ?
  17. inc bx
  18. inc bx
  19. cmp bx, 16
  20. jb tostackc
  21.  
  22. mov bx, 0 ;????????
  23. mov di, 0 ;???? ????????(????? ?????? ??? ?????????, ??? ????????? ? ??? ????????? ? ????????: ????? ?? ?? ????? ??????? ? ??? ???)
  24. pop cx ;??????? ?????? ??????? ?? ?????
  25. mainloop:
  26. cmp di, 40 ;?????????, ? ??????? ? ?? ?? ????? ???????(????? ?? 2, DW)
  27. je popcx ;???? ????? ?? ????????? ??????? - ???? ? ?????
  28. mov ax, a+bx ;?????? ? ?? ??????? ??????? ??????? ?(?????? ???????????, ???????????)
  29. mov xa, ax ;?????
  30. mov xb, cx ;????? 2
  31. ;mov cx, b+di
  32. cmp ax, cx ;?????????? ??????? ???? ??????? ? ? ????????? ? ?????
  33. je equals ; ???? ????? ???? ? ?????
  34. ;;;;;
  35. cmp a+bx, 0 ;???? ?? ??? ?? ????????, ??????? ???????? ????? ????, ? ?????????? 2 ?????? ?? ????????? -
  36. je call adding ;?????? ???????? ? ??????? ? ??? ???, ???? ? ?????
  37. afteradd:
  38. inc bx ;???????????, ???? ??? ?????? ?? ? ???????? ???????? ?? ????? ????
  39. inc bx
  40. cmp cx, 2000
  41. je end
  42. jmp mainloop ;?????????(????????? ???? ?? ?? ???????? ????????(???????? = 0, ??????? ??????? = 20), ???? ?? ?????????? ????????)
  43.  
  44. popcx: ;???? ?? ???? ????? - ?????? ???? ?????? ???? ??????? ?? ?????
  45. mov bx, 0 ;???????? (???? ????????? ??????? ???? ??????)
  46. pop cx ;???????? ??? ???????
  47. mov di, 0 ;??????
  48. mov xb, cx ;?????
  49. jmp mainloop ;?????????
  50.  
  51. adding proc
  52. mov bx, 0
  53. addPoint:
  54. push cx
  55. mov cx, a+bx
  56. mov xa, cx
  57. pop cx
  58. cmp a+bx, 0
  59. je zero
  60. inc bx
  61. inc bx
  62. jmp addPoint
  63.  
  64. zero:
  65. mov xb, cx
  66. mov cx, xb
  67. mov xb, cx
  68. mov a+bx, cx
  69. mov bx, -2
  70. pop cx
  71. mov di, 0
  72. mov xb, cx
  73. adding endp
  74. jmp afteradd
  75.  
  76. equals:
  77. mov bx, 0
  78. inc di
  79. inc di
  80. pop cx
  81. jmp mainloop
  82.  
  83.  
  84. end:
  85.  
  86. ret
  87.  
  88. a dw 20 dup (0)
  89. b dw 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
  90. c dw 20, 2, 5, 1, 2, 7, 9, 2, 4, 5
  91. xa dw 0
  92. xb dw 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement