Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do 64 Bit architectures memory addresses still hold 1 byte

In a 32 bit machine, if you copied an int p, it would copy 4 bytes of information, which would be addressed at 0xbeefbeef, 0xbeefbef0, 0xbeefbef1, 0xbeefbef2 respectively.

Is this the same with 64 bit? Or does it store 2 bytes at a single address?

like image 738
David van Dugteren Avatar asked Oct 23 '25 23:10

David van Dugteren


1 Answers

It depends on the architecture. On most "normal" 64-bit systems (e.g. arm64, x86_64, etc.) memory is "byte addressed," so each memory address refers to one byte (so it's the same as your 32-bit example).

There are systems out there which are not byte addressed, and this can included 64-bit architectures. For example, DSPs are a classic example of systems where char can be 32-bits (or more) and an individual byte (or rather, octet) is not addressable.

like image 160
Cornstalks Avatar answered Oct 26 '25 13:10

Cornstalks