Advertisement
artur99

ASM Base 10 to Base 4 (char)

Jan 25th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. void base10To4(int, char*) {
  2.     _asm {
  3.         mov eax, [ebp+8]
  4.         mov ebx, 4 // new base
  5.         mov ecx, 0
  6.         mov esi, [ebp+12]
  7.         _while1:
  8.             mov edx, 0
  9.             div ebx
  10.             add edx, '0'
  11.             mov [esi+ecx], dl
  12.  
  13.             inc ecx
  14.             cmp al, 0
  15.             je _endwhile
  16.             jmp _while1
  17.         _endwhile:
  18.            
  19.         mov byte ptr[esi + ecx], 0
  20.  
  21.     };
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement