Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .section .text
- .global inter_to_oct_str_float
- inter_to_oct_str_float:
- pushl %ebp
- movl %esp, %ebp
- subl $4, %esp
- pushl %esi
- pushl %edi
- movl $0, -4(%ebp)
- movl 8(%ebp), %eax #broj
- movl 12(%ebp), %ecx #adresa niza
- movl $8, %esi #jer mnozimo sa 8
- movl $100000000, %edi #jer delimo sa 10...0
- cmpl $3, 16(%ebp)
- je greska
- movb $'0', (%ecx)
- incl %ecx
- decl 16(%ebp)
- movb $'.', (%ecx)
- incl %ecx
- decl 16(%ebp)
- pocetak:
- decl 16(%ebp)
- cmpl $0, 16(%ebp)
- je kraj_pod
- xorl %edx, %edx
- mull %esi
- #jc greska
- divl %edi
- addb $'0', %al
- movb %al, (%ecx)
- incl %ecx
- movl %edx, %eax
- andl %eax, %eax
- jz kraj_pod
- jmp pocetak
- greska:
- movl $1, -4(%ebp)
- kraj_pod:
- movl $0, (%ecx)
- movl -4(%ebp), %eax
- popl %edi
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
Add Comment
Please, Sign In to add comment