Guest User

Untitled

a guest
Jan 24th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. .intel_syntax
  2. .data
  3. .globl _x
  4. .globl _y
  5. _x: .long 0
  6. _y: .long 0
  7.  
  8.  
  9.  
  10.  
  11. .globl_mult #_mult is publicly visible
  12.  
  13. _mult:
  14. push ebp
  15. mov ebp,esp
  16.  
  17. mov eax, 0 #prod = 0 ;
  18. mov edx, _y
  19. mov ecx, _x
  20.  
  21. LOOP:
  22. cmp ecx, 0
  23. jg done
  24.  
  25. test ecx,01h
  26. je is_zero
  27. add eax,edx
  28.  
  29. is_zero:
  30. shr,eax
  31. shl,edx
  32.  
  33.  
  34. DONE:
  35. pop ebp
  36. ret
Add Comment
Please, Sign In to add comment