Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Bellow sorts the array in the least efficient way I know aside from random, which honestly could be faster, because random
- mov ecx, 0
- mov edi, 0
- mov esi, 0
- mov ebx, 0
- top_sort:
- cmp edi, 10
- jge top_sort_end
- mov ebx, esi
- inner_loop:
- cmp ebx, 10
- jge end_loop1
- mov eax, DWORD [numArr + ebx * 4]
- cmp eax, DWORD [numArr + ebx + 1 * 4]
- jge swapper
- inc ebx
- jmp inner_loop
- swapper:
- mov ecx, DWORD [numArr + ebx + 1 * 4]
- mov DWORD [numArr + ebx * 4], ecx
- mov DWORD [numArr + ebx + 1 * 4], eax
- inc ebx
- jmp inner_loop
- end_loop1:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement