I don't get much time to write 32 bit code these days but since its prototype was wasted in the campus, here is a derivation of the first version that is self contained and full register design. Nothing to test it against but it runs OK.
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
include \masm32\include\masm32rt.inc
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
comment * -----------------------------------------------------
Build this template with
"CONSOLE ASSEMBLE AND LINK"
----------------------------------------------------- *
tRev PROTO pstr:DWORD
.data
numz db "1234567890",0
.code
start:
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
call main
inkey
exit
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
main proc
LOCAL rval :DWORD
invoke tRev,ADDR numz ; reverse the number above
mov rval, eax
print rval,13,10
ret
main endp
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
tRev proc pstr:DWORD
; ---------------------------------------------
; in place string reverse, fully self contained
; ---------------------------------------------
push ebx ; save EBX
push edi
push esi
mov edi, [ebp+8]
mov eax, edi
sub eax, 1
@@: ; unroll by 4
REPEAT 3
add eax, 1 ; get length
cmp BYTE PTR [eax], 0 ; loop to buffer end
je @F
ENDM
add eax, 1 ; get length
cmp BYTE PTR [eax], 0 ; loop to buffer end
jne @B
@@:
sub eax, edi ; sub address from eax for len
mov esi, eax ; store length in esi
shr eax, 1 ; get integer half length of string
mov ebx, eax ; store it in variable
mov eax, edi ; eax has start char
mov edx, edi ; load start address
add edx, esi ; get end character address
sub edx, 1 ; sub 1 to get end char
mov esi, ebx ; copy half len into edi
@@:
movzx ebx, BYTE PTR [eax] ; load start char
movzx ecx, BYTE PTR [edx] ; load end char
mov [eax], cl ; reverse char pair
add eax, 1 ; increment start char
mov [edx], bl
sub edx, 1 ; decrement end char
sub esi, 1 ; sub 1 from half length
jnz @B ; loop back if its not zero
mov eax, edi ; return the address in eax
pop esi
pop edi
pop ebx ; restore EBX
ret 4 ; balance the stack by 4 bytes
tRev endp
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
end start