Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Program za odredjivanje palindroma
- #Autor:Aleksandar POpovic ra 64/2011
- .section .data
- string: .ascii "Unesite string:"
- str_len= .-string
- string1: .ascii "Ovo je palindrom"
- str1_len= .-string1
- string2: .ascii "Ovo nije palindrom"
- str2_len= .-string2
- string3_max=30
- string3: .fill string3_max,1,0
- .section .text
- .globl main
- main:
- movl $0,%edx
- movl $4,%eax
- movl $1,%ebx
- leal string,%ecx
- movl $str_len,%edx
- int $0x80
- movl $3,%eax
- movl $0,%ebx
- leal string3,%ecx
- movl $string3_max,%edx
- int $0x80
- movb $0, -1(%ecx,%eax,1)
- movl $string3,%ecx
- movl $0,%esi
- movl $0,%edi
- poredjenje1:
- cmpb $0,(%ecx)
- je nastavak
- incl %ecx
- incl %edi
- jmp poredjenje1
- nastavak:
- subl $1,%edi
- movl $string3,%ecx
- smestanje:
- movb (%ecx,%edi,1),%dl
- movb (%ecx,%esi,1),%al
- prva: cmpb $'',%al
- je uvecaj
- cmpb $'',%dl
- je uvecaj1
- poredjenje:
- cmpl %esi,%edi
- ja labela
- je jednako
- jb ispis
- jednako:
- cmpb %al,%dl
- je ispis1
- jmp ispis
- labela:
- cmpb %al,%dl
- je uvecanje
- jmp ispis
- uvecanje:
- incl %esi
- decl %edi
- jmp smestanje
- uvecaj:
- incl %esi
- jmp smestanje
- uvecaj1:
- decl %edi
- jmp smestanje
- ispis1:
- movl $4,%eax
- movl $1,%ebx
- leal string1,%ecx
- movl $str1_len,%edx
- int $0x80
- jmp kraj
- ispis:
- movl $4,%eax
- movl $1,%ebx
- leal string2,%ecx
- movl $str2_len,%edx
- int $0x80
- kraj:
- movl $1,%eax
- int $0x80
Add Comment
Please, Sign In to add comment