Why does a memory address only contain 16 bytes of data?

0x8048384 <main+16>: 0x00fc45c7 0x83000000 0x7e09fc7d 0xc713eb02
0x8048394 <main+32>: 0x84842404 0x01e80804 0x8dffffff 0x00fffc45

So each memory address contains 16 bytes of data? 4x4 = 16. So 4 bytes is = 0x00fc45c7

Am I right?

5

1 Answer

It doesn't. A specific address in memory generally points to one byte of memory. However, your display here is showing you every byte of memory from 0x8048384 to 0x80483A4 - That's 32 bytes of memory, organized into 2 rows of 4 4-byte values.

If you look carefully on the left side, the addresses don't increment by one between the lines, but rather by 16: 84 -> 94 (in base 16), which tells you that there are 16 bytes of memory being displayed on each line. This is often more convenient than 1-byte-per-line, and these 16-byte lines are further broken down into 4-byte groups because it's quite common to use aligned, 32-bit numbers, which each grouping of 4 bytes represents. This makes it easier to visually process the information without resorting to other tools for interpretation.

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like