Guest User

Untitled

a guest
May 20th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. %include "gt.asm"
  2. covar
  3. sum: dd 1000
  4. a: resd 1
  5. b: resd 1
  6. c: resd 1
  7. deling: resd 1
  8. drie: dd 3
  9. een: dd 1
  10. twee: dd 2
  11. nul: dd 0
  12. deling2: resd 1
  13.  
  14. aa: resd 1
  15. bb: resd 1
  16. cc: resd 1
  17.  
  18. inleiding
  19. mov eax, [sum]
  20. mov edx, 0
  21. idiv dword [drie]
  22. mov [deling], eax
  23. mov edx, 0
  24.  
  25.  
  26. herloopa: mov eax, [a]
  27. add eax, [een]
  28. mov [a], eax
  29. mov eax, [a]
  30.  
  31. cmp eax, [deling]
  32. jg einde
  33.  
  34.  
  35. mov eax, [a]
  36. add eax, [een]
  37. mov [b], eax
  38.  
  39.  
  40. herloopb: mov eax, [b]
  41. add eax, [een]
  42. mov [b], eax
  43.  
  44. mov eax, [sum]
  45. mov edx, 0
  46. idiv dword [twee]
  47. mov [deling2], eax
  48.  
  49. mov eax, [b]
  50. cmp eax, [deling2]
  51.  
  52. jg herloopa
  53.  
  54.  
  55.  
  56. mov eax, [sum]
  57. sub eax, [a]
  58. mov [c], eax
  59. mov eax, [c]
  60. sub eax, [b]
  61. mov [c], eax
  62.  
  63.  
  64.  
  65.  
  66.  
  67. mov eax,[c]
  68. cmp eax, [nul]
  69. jle herloopb
  70.  
  71.  
  72. mov eax, [a]
  73. mov edx, 0
  74. imul dword [a]
  75. mov [aa], eax
  76.  
  77. mov eax, [b]
  78. mov edx, 0
  79. imul dword [b]
  80. mov [bb], eax
  81.  
  82. mov eax, [c]
  83. mov edx, 0
  84. imul dword [c]
  85. mov [cc], eax
  86.  
  87.  
  88. mov eax, [aa]
  89. add eax, [bb]
  90. mov [aa], eax
  91. mov eax, [aa]
  92. cmp eax, [cc]
  93.  
  94.  
  95. je gevonden
  96. jne herloopb
  97.  
  98.  
  99. gevonden: uit [a]
  100. uit [b]
  101. uit [c]
  102.  
  103. slot
  104.  
  105. begin2opnieuw: slot
  106.  
  107. einde: uit [sum]
  108. slot
Add Comment
Please, Sign In to add comment