I have tried with the algorithm below but it does not generate the results i am looking for and i am a bit stumped. I have tried swapping the elements in the array, unless you know there is a less trouble sum alternative example: 1,2,3,4,5 becomes 5,4,3,2,1. i have searched all over online and nothing seems to work efficiently. my professor does not want us to code our own but to find one online and understand what is happening to use it in a larger program with reversing the array being a smaller function.
(sorry the daniweb insert code function is not working)
mov esi, array
mov edi, array
add edi, 16
reverseloop:
nop
mov eax, edi
mov ebx, esi
;swap elements
mov dword [edi], eax
mov dword [esi], ebx
add esi, 4
sub edi, 4
cmp esi, edi
jb reverseloop
ret