Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- format PE console
- entry start
- include '../include/win32a.inc'
- section '.imports' import data readable
- library kernel,'kernel32.dll', msvcrt,'msvcrt.dll'
- import kernel, ExitProcess,'ExitProcess'
- import msvcrt, printf,'printf' , getchar,'_fgetchar'
- section '.data' data readable writable
- strformat db "%s",0ah,0 ; 0ah for new line and 0 for null charchter
- nameSize dd 5
- name db "abcba",0
- palindrome db "Palindrome", 0
- notPalindrome db "Not palindrome", 0
- section '.code' code readable executable
- solve :
- mov eax, 1
- mov ecx, [nameSize]
- push ebx
- mov ebx, 0
- L1 :
- push ebx
- mov bl, [name + ebx]
- cmp [name + ecx - 1], bl
- je elsee
- mov eax, 0
- elsee:
- pop ebx
- inc ebx
- loop L1
- pop ebx
- ret
- start:
- call solve
- cmp eax, 1
- jne notPal
- invoke printf, strformat, palindrome
- jmp Pal
- notPal: invoke printf, strformat, notPalindrome
- Pal:
- invoke getchar ; wait for any key
- invoke ExitProcess, 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement