Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .section .data
- uneti: .fill 51,1,0
- duzina = 51
- prepisan: .fill 51,1,0
- poruka1: .ascii "Unesite string: \0"
- br_poruka1 = . - poruka1
- poruka2: .ascii "Dobijeni string: \0"
- br_poruka2 = . - poruka2
- main:
- movl $4, %eax #ispis unesite string
- movl $1, %ebx
- leal poruka1, %ecx
- movl $br_poruka1, %edx
- int $0x80
- movl $3, %eax #unos stringa
- movl $0, %ebx
- leal uneti, %ecx
- movl $duzina, %edx
- int $0x80
- movl $0, %esi
- proveri:
- movl %esi, %edi
- cmpb $0, uneti(,%esi, 1)
- je ispis
- cmpb $48, uneti(,%esi, 1)
- jb izbaci
- cmpb $57, uneti(,%esi, 1)
- ja izbaci
- addl $1, %esi
- jmp provera
- izbaci:
- cmpb $0, uneti(,%esi, 1)
- je nastavi
- movl uneti(,%edi, 1)
- nastavi:
- ispis:
- movl $4, %eax #ispis dobijen string
- movl $1, %ebx
- leal poruka2, %ecx
- movl $br_poruka2, %edx
- int $0x80
- movl $4, %eax #ispis stringa
- movl $1, %ebx
- leal uneti, %ecx
- movl $duzina, %edx
- int $0x80
- kraj:
- movl $1, %eax
- movl $0, %ebx
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement