Register | Login
Forum Index > Samples > dw2hex - dword to hexadecimal
Author Message
Pages: 1
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1126] dw2hex - dword to hexadecimal - posted: 2012-05-17 16:05:32
Another sample function for dword to hexadecimal conversion, it is very simple and probably could be optimized if you are not bothered to preserve ecx - edi

Code:
//
// dw2hex - Code::zIron. 2012.
// buf len minimum length 12 bytes
//
function dw2hex(DWord val; char* buf) {
  uses ecx edi esi;
  
  edi = buf;
  ecx = val;
  esi = '0123456789ABCDEF';
      
  $repeat 8:
    eax = ecx;
    eax >> 28;

    al = [esi+eax];
    stosb

    ecx << 4;
  $end;
  
  char*[edi] = "h";
  
  return buf;
}


Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 2 user(s) online. 0 member(s) and 2 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd