Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .section .data
- str1: .fill 50,1,42
- str1_len = .-str1
- not_alphanum: .byte 0
- .section .text
- .global main
- main:
- movl $3, %eax
- movl $0, %ebx
- leal str1, %ecx
- movl $str1_len, %edx
- int $0x80
- movl %eax, %esi #esi sadrzi duzinu stringa
- leal str1, %eax #adresa stringa u %eax
- decl %eax
- decl %esi
- proveri:
- incl %eax
- cmpb $'\n', (%eax)
- je ispis
- cmpb $'0', (%eax)
- jb zameni
- cmpb $'9', (%eax)
- jbe proveri
- cmpb $'A', (%eax)
- jb zameni
- cmpb $'Z', (%eax)
- jbe proveri
- cmpb $'a', (%eax)
- jb zameni
- cmpb $'z', (%eax)
- jbe proveri
- zameni:
- incb not_alphanum
- movb $'0', (%eax)
- jmp proveri
- ispis:
- movl $4, %eax
- movl $1, %ebx
- leal str1, %ecx
- movl %esi, %edx
- int $0x80
- kraj:
- movl $1, %eax
- movb not_alphanum, %bl
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement