Computer Science Canada

Converting memory address (hex) to decimal

Author:  hamid1455 [ Sat Mar 30, 2013 12:48 pm ]
Post subject:  Converting memory address (hex) to decimal

I'm trying to learn to convert hex memory addresses to decimal format..

so I have this memory address: 0x0065fd40
and am trying to convert it to dec

Here is what I did:

1) Shift the segment part one left

2) Add the offset to the new segment

And I got: 0x17090

I don't know how to check it. I am sure 0x0065fd40 is NOT the same thing as 0x17090.

I'm using a tutorial labeled hex-ram-tutorial which I found on google..

Author:  nullptr [ Sat Mar 30, 2013 2:17 pm ]
Post subject:  Re: Converting memory address (hex) to decimal

If you just need to convert addresses, use an online converter like this one: http://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html

If you want to do it with a program, there's probably some option built into the language for that. Tell us which language you're using and we can point you in the right direction.

Author:  hamid1455 [ Sun Mar 31, 2013 12:50 pm ]
Post subject:  Re: Converting memory address (hex) to decimal

nevermind, I figured it out. The site I was referring to as a guide said to just add up the individual hex digits, it didn't say to subtract 16 from the added hex values IF the added hex values are greater than or equal to 16. If the added hex values are greater than or equal to 16, carry over to the next column of hex digits.

I'm using C++ and visual studio 2010, but I posted in general programming, because I just wanted to generally have an idea of how to convert addresses by hand


: