Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .386
- .model flat, stdcall
- option casemap :none
- include \masm32\include\masm32rt.inc
- .data
- prompt db "Insert string:",0
- same_msg db "Both string are the same.",0
- diff_msg db "The strings are different.",0
- string db 50 dup(?)
- string2 db 50 dup(?)
- .code
- main:
- push offset prompt
- call StdOut
- push 50
- push offset string
- call StdIn
- push offset prompt
- call StdOut
- push 50
- push offset string2
- call StdIn
- push offset string2 ; Push both string offsets (pointers)
- push offset string
- call crt__stricmp
- add esp, 8 ; Remove 8 bytes from stack (2 string pointers)
- ; crt_stricmp is CDECL "C" calling convention
- ; which requires the caller to clean the stack
- cmp eax, 0
- ; je same ; Not needed
- jne diff
- same:
- push offset same_msg
- call StdOut
- jmp fin ; We want to exit, not to fall into "diff" code
- diff:
- push offset diff_msg
- call StdOut
- fin:
- ret ; Return to exit or do: call ExitProcess
- end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement