daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. proc int32_ToStr
  2.         ; EAX = value
  3.         ; EDI = buffer
  4.         ; ESI = Length used
  5.         xor     esi,esi
  6.         mov     ecx,10
  7.     .stack_dec:
  8.         inc     esi        ; Increment counter
  9.         xor     edx,edx    ; Zero edx
  10.         div     ecx        ; Divide EAX by ECX, remainder stored in EDX
  11.         add     edx,'0'    ; Turn EDX into ascii char
  12.         push    edx        ; Push character
  13.         test    eax,eax    ; Is EAX 0?
  14.         jz      .purge_dec ; Yes. Jmp to end
  15.         jmp     .stack_dec
  16.     .purge_dec:
  17.         mov     ebx,esi
  18.      @@:
  19.         pop     dword [edi]
  20.         inc     edi
  21.         dec     ebx
  22.         test    ebx,ebx
  23.         jnz     @b
  24.         ret
  25.   endp
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top