Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .section .data
- poruka: .ascii "Unesite string:\0"
- len1 = .-poruka
- poruka2: .ascii "Upcase:\0"
- len2 = .-poruka2
- max = 30
- string: .fill max, 1, 42
- .section .text
- .globl main
- main:
- movl $4, %eax
- movl $1, %ebx
- leal poruka, %ecx
- movl $len1, %edx
- int $0x80
- movl $3, %eax
- movl $0, %ebx
- leal string, %ecx
- movl $max, %edx
- int $0x80
- movl %eax, %edi
- pocetak:
- movl $string, %esi
- provera1:
- cmpb $'a', (%esi)
- jl petlja
- cmpb $'z', (%esi)
- jg petlja
- subb $32, (%esi) #prvo slovo postaje veliko
- incl %esi
- petlja:
- cmpb $10, (%esi)
- je ispis
- cmpb $' ', (%esi)
- je slovo
- incl %esi
- jmp petlja
- slovo:
- cmpb $'a', 1(%esi)
- jl nista
- cmpb $'z',1(%esi)
- jg nista
- subb $32, 1(%esi)
- incl %esi
- jmp petlja
- nista:
- incl %esi
- jmp petlja
- ispis:
- movl $4, %eax
- movl $1, %ebx
- leal poruka2, %ecx
- movl $len2, %edx
- int $0x80
- movl $4, %eax
- movl $1, %ebx
- leal string, %ecx
- movl %edi, %edx
- int $0x80
- kraj:
- movl $1, %eax
- movl $0, %ebx
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement