Advertisement
Guest User

Untitled

a guest
May 27th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .section .text
  2. .globl inter_to_oct_str
  3.  
  4. inter_to_oct_str:
  5.     pushl %ebp
  6.     movl %esp,%ebp
  7.     movl 8(%ebp),%eax
  8.     movl 12(%ebp),%esi
  9.     movl 16(%ebp),%edi
  10.     movl $8,%ebx
  11.     movl $0,%ecx
  12.     andl %eax,%eax
  13.     jns nije
  14.     movb $'-',(%esi)
  15.     incl 12(%ebp)
  16.     incl %esi
  17.     decl %edi
  18.     negl %eax
  19. nije:
  20.     decl %edi
  21.     cmpl $1,%edi
  22.     jl nemere
  23.     movl $0,%edx
  24.     divl %ebx
  25.     addb $'0',%dl
  26.     movb %dl,(%esi)
  27.     incl %esi
  28.     andl %eax, %eax
  29.    jnz nije
  30.     movb $0,(%esi)
  31.     decl %esi
  32.     movl 12(%ebp),%edi
  33. petlja:
  34.     cmpl %esi,%edi
  35.     jae kraj
  36.     movb (%esi),%ah
  37.     movb (%edi),%al
  38.     movb %al,(%esi)
  39.     movb %ah,(%edi)
  40.     decl %esi
  41.     incl %edi
  42.     jmp petlja
  43. nemere:
  44.     incl %ecx
  45. kraj:
  46.     movl %ecx,%eax
  47.     movl %ebp,%esp
  48.     popl %ebp
  49.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement