Assembly bubble sort swap
I'm trying to do a bubble sort in x86 assembly (yes it has to be bubble, as I'm not concerned about speed optimization regarding different types of sorts) and for some reason, my code will not swap the necessary values. Here is my code mov eax, list ;store list in eax mov edx,[eax+4*edi-4] ;temp = var1 cmp edx,[eax+edi*4] ;compare JLE SECOND_LOOP ;jump if var1 < var2 mov [eax+4*edi-4],[eax+edi*4] ;var1 = var2 mov [eax+edi*4], edx ;var2 = temp jmp SECOND_LOOP At the last mov instruction where it's supposed to load the temp back into the address, it..doesn't. The EAX register has the starting