Created
April 10, 2017 05:58
-
-
Save jryebread/6901c4cbe53c91deacefc6ecad86e7de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BubbleSort PROC | |
| ;//performs the bubble sort algorithm | |
| ;//recieves ESI: offset of myarray and ECX: The length | |
| push eax | |
| L1: | |
| mov eax, [esi] | |
| mov edx, [esi + 4] | |
| cmp edx, eax | |
| jg swapo | |
| jmp ending | |
| swapo: | |
| xchg eax, edx | |
| mov [esi], eax | |
| mov [esi + 4], edx | |
| ending: | |
| add esi, TYPE DWORD | |
| loop L1 | |
| pop eax | |
| ret | |
| BubbleSort ENDP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment