# Looking for a good tool for doing hex math

While I'm writing about all of these address tricks -- I figured I'd ask around if there's a good tool for manipulating hex values.  I just use "calc" which comes with Windows; if you put it into scientific mode it will handle hex values for you.  But it doesn't have very good shifting or bitwise functionality, and it always uses 64-bit values.  Most of the time I want to subtract and get the 32-bit value, not FFFFFFFF FFFFFFFF.  I like how easy it is to flip between hex and decimal in calc, but I wish I could do it without using the mouse.

So I figured I'd ask and see if anyone else knows of a better tool.

1. CN says:

It only uses 64-bit values if Qword is chosen. If you change it to Dword or Word (or Byte!) you get 32, 16 and 8 bits, respectively.

Only the nibble and single-bit arithmetics missing…

2. CN says:

BTW, try F5 and F6 out. I hope you’ll be happy with them…

3. Sue Loh says:

Rock ON, CN! 🙂 I’ll remember F5 and F6.

And you know, as I was writing that I was thinking I had seen once upon a time, a way to change to DWORD math. I went and hunted the menus but the selection was right in front of my face and I missed it. Blind. Is there a keyboard shortcut for that? 😉 Or even better, I wish it would remember my previous selection.

4. TM says:

Once you’re in HEX mode:

F12 = Qword

F2 = Dword

F3 = Word

F4 = Byte

It still won’t remember your last setting, alas.

5. Matt says:

F12, F2, F3, and F4 select Qword, Dword, Word, and Byte math, respectively.

6. Kevin says:

You might want to try SuperCalc, from http://www.catch22.net/software/supercalc.asp

It allows calculations (including arithmetic, shifting, masking, etc) to be done by entering C language expressions. You can set the word size of the results to 8, 16, or 32 bits.

7. Sue Loh says:

Thanks Kevin, I’ll give it a try.

8. Jeff says:

Buy yourself a Hp16C programmer’s calculator. They don’t make them anymore, but you can get one on eBay. Plus you get extra points since it uses RPN. It can handle 1’s or 2’s compliment, and setting width. Best programmer’s calculator ever.

-Jeff

9. james g. says:

Go look for hex workshop.

10. Bas hendriks says:

if you like to freak with hp calculators…

HP Calculator Emulators for the PC

http://www.hpcalc.org/hp48/pc/emulators/

11. Sarah says:

Hi Sue

Try the following sites:

http://www.iboost.com/tools/number.htm

http://centricle.com/tools/ascii-hex/

I tend to use them for this sort of stuff if I need it in a hurry… cut & paste is a wonderful thing sometimes! 🙂