Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .section .data
- text: .ascii "Zdravo, Svete!\0"
- samoglasnici: .ascii "AEIOUaeiou\0"
- STRLEN_SAMOG 11
- broj: .long 0
- strlen_text: .long
- tempEAX: .long 0
- tempEBX: .long 0
- tempECX: .long 0
- tempEDX: .long 0
- .section .text
- .globl main
- main:
- movl $text, %eax
- jmp str_len_text # poziv kobajagi potprograma
- povratak_iz_potprograma:
- movl $0, %esi # ovo ce da bude i
- movl $0, %edi # ovo ce da bude j
- for_i:
- cmpl strlen_text, %esi # i<strlen(text)
- je kraj
- for_j:
- cmpl STRLEN_SAMOG, %edi # j< strlen(samoglasnici)
- je for_i
- movb text(, %esi, 1), %ebx # povlacimo element iz teksta
- movb samoglasnici(, %edi, 1), %ecx #povucemo element samoglasnik
- cmpb %ebx, %ecx
- jne for_j
- inc broj
- jmp for_j
- str_len_text:
- # Sacuvam regove da bi mogao
- # da ih koristim za svoj potprogram
- movl %eax, tempEAX
- movl $text, %eax
- while:
- cmpb $0, (%eax)
- je pocisti_za_sobom
- incl strlen_text
- jmp while
- movl tempEAX %eax
- jmp povratak_iz_potprograma
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement