Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Program za stripovanje stringa
- # dmarjanovic
- .section .data
- str_1: .ascii " dragutin marjanovic \0"
- .section .text
- .globl main
- main:
- movl $0, %esi
- for_length:
- cmpb $0, str_1(,%esi,1)
- je continue
- incl %esi
- jmp for_length
- continue:
- decl %esi
- right_strip:
- cmpb $32, str_1(,%esi,1)
- jne next_continue
- movb $0, str_1(,%esi,1)
- decl %esi
- jmp right_strip
- next_continue:
- movl $0, %ebp
- movl $0, %esi
- for_space:
- cmpb $32, str_1(,%esi,1)
- jne left_strip
- incl %esi
- jmp for_space
- left_strip:
- cmpb $0, str_1(,%esi,1)
- je end
- movb str_1(,%esi,1), %cl
- movb %cl, str_1(,%ebp,1)
- incl %esi
- incl %ebp
- jmp left_strip
- end:
- movl $0, str_1(,%ebp,1)
- movl $1, %eax
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement