Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Converting memory address (hex) to decimal
Author Message
hamid1455

Posted: 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..

nullptr

Posted: 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.
hamid1455

Posted: 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
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 3 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: