Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .section .data
- NELEM=3
- smax=96
- a: .long 0x12345678, 0x23456789, 0x34567890
- max: .long 0
- poz: .long 0
- string: .fill smax,1,0
- .section .text
- .globl main
- main:
- movl $0, %esi
- restart:
- movl $0, %edx
- cmpl $NELEM, %esi
- je dalje
- movl a(,%esi,4), %eax
- nesto1:
- andl %eax, %eax
- jz nesto2
- shrl $1, %eax
- jnc nesto1
- incl %edx
- jmp nesto1
- nesto2:
- incl %esi
- cmpl max, %edx
- jbe restart
- movl %edx, max
- movl %esi, poz
- decl poz
- jmp restart
- dalje:
- leal string, %edi
- movl poz, %esi
- movl a(, %esi,4), %ebx
- movl $1, %esi ##0 ili 1, brojac
- petlja:
- xorl %edx, %edx
- movl %esi, %eax
- shrl $1, %ebx
- jnc nije_kec
- movl $10, %ecx
- divl %ecx
- andl %eax, %eax
- jz dalje2
- addb $48, %al
- movb %al, (%edi)
- incl %edi
- dalje2:
- addb $48, %dl
- movb %dl, (%edi)
- incl %edi
- movb $' ', (%edi)
- incl %edi
- nije_kec:
- incl %esi
- andl %ebx, %ebx
- jz dalje3
- jmp petlja
- dalje3:
- movl $4, %eax
- movl $1, %ebx
- leal string, %ecx
- movl %edi, %edx
- decl %edi
- int $0x80
- kraj:
- movl $1, %eax
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement