flat assembler
Message board for the users of flat assembler.
Index
> Main > huge decimal number to hexadecimal 
Author 

nooob 14 Nov 2008, 11:24
hello gurus
how to convert a huge negative or positive 128 bit number or above from decimal to hexadecimal using only 486 32 bit instructions set? 

14 Nov 2008, 11:24 

vid 14 Nov 2008, 11:49
You need to create your own set of bignum routines, capable to add digit to bit number, and capable to multiply big number by 10.
Then you must convert decimal number to bignumr: set big num X to 0, and go from low (last) to high (first) digit of decimal number. For each digit, multiply x by 10, and then add value of digit to x. When you are done with that, converting binary big number to hex is very easy, just one hex digit per 4 bits of big number. About manipulation with bignums, see this article: http://x86asm.net/articles/workingwithbignumbersusingx86instructions/index.html 

14 Nov 2008, 11:49 

Vasilev Vjacheslav 14 Nov 2008, 14:18
use miracl and do not reinvent the wheel


14 Nov 2008, 14:18 

bitRAKE 15 Nov 2008, 03:31
Accumulate digits to a larger (like 10^9) base then merge with BIGINT for speed. Wheels should be reinvented because the roads are changing...


15 Nov 2008, 03:31 

Vasilev Vjacheslav 15 Nov 2008, 10:49
i suggest to use square wheels if so


15 Nov 2008, 10:49 

bitRAKE 16 Nov 2008, 17:50
There are roads where square wheels would be optimal!


16 Nov 2008, 17:50 

< Last Thread  Next Thread > 
Forum Rules:

Copyright © 19992023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.