Advertisement
Guest User

OptimizeMe.nasm

a guest
Apr 27th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. global sumAtoB
  2.  
  3.  
  4. SECTION .text
  5.  
  6. sumAtoB:
  7.         push    ebp
  8.         mov     ebp, esp
  9.         sub     esp, 16
  10.         mov     eax, dword [ebp+8]
  11.         mov     dword [ebp-8], eax
  12.         mov     dword [ebp-4], 0
  13.         jmp     L_002
  14.  
  15. L_001:  
  16.     mov     eax, dword [ebp-8]
  17.         add     dword [ebp-4], eax
  18.         add     dword [ebp-8], 1
  19.  
  20. L_002:  
  21.     mov     eax, dword [ebp-8]
  22.         cmp     eax, dword [ebp+12]
  23.         jle     L_001
  24.         mov     eax, dword [ebp-4]
  25.         leave
  26.         ret
  27.  
  28.  
  29. SECTION .data
  30.  
  31.  
  32. SECTION .bss
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement