Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .686
- .model flat, c
- includelib libcmt.lib
- includelib libvcruntime.lib
- includelib libucrt.lib
- includelib legacy_stdio_definitions.lib
- extern printf_s: proc
- .DATA
- inputFormatString byte "%d", 0
- newLine byte " ", 13, 10, 0
- TEN dword 10
- .CODE
- main proc
- push 4321
- call reverse
- add esp, 4
- push offset newLine
- call printf_s
- add esp, 4
- xor eax, eax
- ret
- main endp
- reverse PROC
- push ebp
- mov ebp, esp
- sub esp, 32
- mov eax, dword ptr [ebp + 8]
- mov ecx, 10
- xor edx, edx
- div ecx
- mov ebx, eax
- push edx
- push offset inputFormatString
- call printf_s
- mov eax, ebx
- add esp, 8
- cmp eax, 0
- je endReverse
- push eax
- call reverse
- add esp, 4
- endReverse:
- mov esp, ebp
- pop ebp
- ret ; return to the main process
- reverse ENDP
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement