Advertisement
Guest User

Untitled

a guest
Oct 8th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. .586
  3. .model flat, stdcall
  4. option casemap: none
  5.  
  6.  
  7. include \masm32\include\windows.inc
  8. include \masm32\include\kernel32.inc
  9. include \masm32\include\masm32.inc
  10. include \masm32\include\debug.inc
  11. include \masm32\include\user32.inc
  12.  
  13. includelib \masm32\lib\kernel32.lib
  14. includelib \masm32\lib\masm32.lib
  15. includelib \masm32\lib\debug.lib
  16. includelib \masm32\lib\user32.lib
  17.  
  18. .data
  19. Arr dd -5,6,2,22,3,45,-6,234,-55,13
  20. Var dw 7
  21. .code
  22. start:
  23.     mov ecx, 1
  24.     mov bx, 0
  25. sum:
  26.     xor eax, eax
  27.     mov eax, [Arr+ecx*4-4]
  28.     cmp eax, 0
  29.     jg addnumb
  30.     inc ecx
  31.     cmp ecx,11
  32.     jne sum
  33.     jmp _exits
  34. addnumb:
  35.     add edx, eax
  36.     inc bx
  37.     cmp bx, Var
  38.     je _exits
  39.     inc ecx
  40.     cmp ecx,11
  41.     jne sum
  42.     jmp _exits
  43.  _exits:
  44.     PrintDec edx
  45.     invoke ExitProcess, NULL
  46.  end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement