Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .section .data
- string: .ascii " abcd \0"
- .section .text
- .global main
- main:
- movl $string, %eax
- kraj_stringa:
- cmpb $0, (%eax) #cmp B - "b" pise zato sto poredimo po jedan karakter, po jedan bajt
- je razmaci
- incl %eax
- jmp kraj_stringa
- razmaci: #izbacivanje razmaka sa kraja
- cmpb $' ', -1(%eax)
- jne izbaci
- decl %eax
- jmp razmaci
- izbaci:
- movb $0, (%eax) #smijesta \0 na mjesto na koje pokazuje (%eax)
- kraj:
- movl $1, %eax
- movl $0, %ebx
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement