Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Program provjerava da li je rijec palindrom
- # autor: dmarjanovic
- .section .data
- string: .ascii "anavolimilovana\0"
- .section .text
- .globl main
- main:
- movl $0, %esi
- for_length:
- cmpb $0, string(,%esi,1)
- je continue
- incl %esi
- jmp for_length
- continue:
- decl %esi
- movl $0, %eax
- for_cmp:
- cmpl %esi, %eax
- je its_palindrome
- movb string(,%eax,1), %bl
- cmpb string(,%esi,1), %bl
- jne not_palindrome
- incl %eax
- decl %esi
- jmp for_cmp
- its_palindrome:
- movl $2, %eax
- jmp end
- not_palindrome:
- movl $-2, %eax
- end:
- movl $1, %eax
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement