Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. ;Bellow sorts the array in the least efficient way I know aside from random, which honestly could be faster, because random
  2.  
  3. mov ecx, 0
  4. mov edi, 0
  5. mov esi, 0
  6. mov ebx, 0
  7. top_sort:
  8. cmp edi, 10
  9. jge top_sort_end
  10.  
  11. mov ebx, esi
  12. inner_loop:
  13. cmp ebx, 10
  14. jge end_loop1
  15.  
  16. mov eax, DWORD [numArr + ebx * 4]
  17. cmp eax, DWORD [numArr + ebx + 1 * 4]
  18. jge swapper
  19. inc ebx
  20. jmp inner_loop
  21.  
  22. swapper:
  23. mov ecx, DWORD [numArr + ebx + 1 * 4]
  24. mov DWORD [numArr + ebx * 4], ecx
  25. mov DWORD [numArr + ebx + 1 * 4], eax
  26.  
  27. inc ebx
  28. jmp inner_loop
  29.  
  30. end_loop1:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement