Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Naći koliko znakova sadrži dati string str1 koji nisu slovo i nisu cifra. Dobijen proj postaviti u 32-bitnu promenljivu not_alphanum
- .section .data
- not_alphanum: .long 0
- str1: .ascii "sh43#@^23er%"
- strlen = . - str1
- .section .text
- .globl main
- main:
- movl $0, %eax
- movl $0, %esi
- while:
- cmpl $strlen, %esi
- jge whileKraj
- # provjerava da li je broj
- cmpb $'0', str1(, %esi, 1)
- jl whileBrojac
- cmpb $'9', str1(, %esi, 1)
- jle dodaj
- # provjerava da li je malo slovo
- cmpb $'a', str1(, %esi, 1)
- jl whileProvjeriVelika
- cmpb $'z', str1(, %esi, 1)
- jle dodaj
- # provjerava da li je veliko slovo
- whileProvjeriVelika:
- cmpb $'A', str1(, %esi, 1)
- jl whileBrojac
- cmpb $'Z', str1(, %esi, 1)
- jle dodaj
- jmp whileBrojac
- dodaj:
- incl %eax
- whileBrojac:
- incl %esi
- jmp while
- whileKraj:
- movl $strlen, %ebx
- subl %eax, %ebx
- movl %ebx, not_alphanum
- kraj:
- movl $1, %eax
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement