Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8396459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:32:28+00:00 2026-06-09T20:32:28+00:00

I’m doing something where I have to interpret the values of raw memory addresses,

  • 0

I’m doing something where I have to interpret the values of raw memory addresses, and I’m trying to find how, essentially, larger than int integral types are stored.

For the sake of this argument, let’s assume a 32 bit architecture, where register size is 32 bits, an int is 32 bits, and a long is 64 bits. Is there some rule of thumb or guideline about how the two register values are aligned?

Let’s just get the “it depends on the architecture / OS / language” arguments out of the way. I’m aware that nothing in this area is remotely portable or standardized (indeed, intentionally not specified in standards). I’m just curious if there’s a general pattern here. I won’t shoot anyone, any answer may erase my hard drive, standard caveats. I’m just curious.

I’m familiar enough with e.g. struct packing and how the compiler will (usually) ensure that types are aligned correctly when they take less space than fits the address boundary – but what happens when they are larger than address boundaries?

I can see a couple of reasonable layouts:

Assuming we’re using address 0x10 and 0x11 to store a long of value, I dunno, 99. I’ll make up some terminology here: lowint is the least significant half of the long, and highint is the most significant half.

If the layout is 0x10 => lowint, 0x11 => highint, then a read of 0x10 would yield a consistent value if the type were either an int or long and doesn’t overflow MAX_INT, which is a nice feature – 0x10 is “99” in either case. We also take up two addresses growing upwards of our base address. On the other hand, the low and high parts seem “reversed”.

If the layout is 0x10 => highint, 0x11 => lowint then the high and low parts are in order, but a read of 0x10 will yield “99” if it were an int and “0” if it were a long – so some investigation into the following address 0x11 is needed to assume that we’re dealing with one long, and not, say, two ints. We still grow upwards.

If the layout is 0x10 => lowint, 0x0F => highint then we’ve grown backwards (i.e. taken up a strange previous address to get our second int of storage), but our ints are in order and reads of 0x10 are consistent across data types. This seems the least likely to me, as it would totally screw with caches and data line reads, but still, it’s another option.

So what is most likely? My gut tells me that option 2 – in-order high and low parts with two ints storage space – would be the most convenient for the hardware, but I’m not positive that this is true. Anyone out there with some anecdotal evidence for any layout?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:32:30+00:00Added an answer on June 9, 2026 at 8:32 pm

    What you are asking here is referring to endianess. It turns out that big-endian vs little-endian vs mixed-endian is a major issue in computer architecture. The first one you mentions (ie 0x10 as lowint) is known as little endian and the second one is big endian.

    We do not need to confuse ourselves on the direction in which things are loaded If we load 16-bits from 0x10 then we will get two bytes from 0x10 and 0x11 no matter the endianess scheme. Pointers rarely point downwards, so your last example, in my experience, never occurrs.

    Registers do matter because the way the processor interprets the high and low bytes (endianess) determines how it is stored in memory. In portable software that depends on specific data structures which are moved across architectures it is necessary to reverse the byte order when the endianess of the processor is different with that of the data structure it is manipulating.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.