Include irvine32.inc
.386
.STACK 4096
EXITPROCESS PROTO,DWEXITCODE:DWORD
.data
rev byte "abcdef",0
ns DWORD ?
str byte "After reversing string: ",0
.code
main proc
mov edx, OFFSET rev
mov Ecx, SIZEOF rev
mov ns,ecx
mov esi,0
L1: movzx eax,rev[esi]
push eax
inc esi
loop L1
mov ecx,ns
mov esi,0
L2: pop eax
mov rev[esi],al
inc esi
loop L2
mov EDX ,OFFSET str
call WriteString
mov EDX ,OFFSET rev
call WriteString
INVOKE EXITPROCESS,0
main ENDP
END main
No comments:
Post a Comment