Skip to content

Instantly share code, notes, and snippets.

@jryebread
Created April 10, 2017 05:58
Show Gist options
  • Select an option

  • Save jryebread/6901c4cbe53c91deacefc6ecad86e7de to your computer and use it in GitHub Desktop.

Select an option

Save jryebread/6901c4cbe53c91deacefc6ecad86e7de to your computer and use it in GitHub Desktop.
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