| View previous topic :: View next topic |
| Author |
Message |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Mon Aug 28, 2006 8:27 am Post subject: Convert numbers larger than 32-bit to Hex? |
|
|
Does anyone know a work around for the "32-bit number" limitation?
I need to write a number, that could be as large as 19327352832, to a file as hex. I can get the large number into a variable... but @hex (like all VDS functions) does not work with numbers larger than 2147483648.
Or any command-line tool that I can send the number to and get the hex value returned? _________________ cheers
Dave |
|
| Back to top |
|
 |
mmatica Newbie
Joined: 03 Dec 2004 Posts: 12
|
Posted: Mon Aug 28, 2006 6:00 pm Post subject: Re: Convert numbers larger than 32-bit to Hex? |
|
|
| DaveŽ wrote: | Does anyone know a work around for the "32-bit number" limitation?
I need to write a number, that could be as large as 19327352832, to a file as hex. I can get the large number into a variable... but @hex (like all VDS functions) does not work with numbers larger than 2147483648.
Or any command-line tool that I can send the number to and get the hex value returned? |
You can use the function:
:xhex
%1 = @fint(%1)
%q = @fint(@fdiv(%1,268435456))
%r = @fsub(%1,@fmul(%q,268435456))
exit @hex(%q,1)@hex(%r,7)
Mate |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Mon Aug 28, 2006 11:40 pm Post subject: |
|
|
Thanks Mate. _________________ cheers
Dave |
|
| Back to top |
|
 |
|