X86 and memory addressing

I read on memory models in a compilation that I took, and I have a question or two. Let's say that the address bus has 32 lines, the data bus has 32 lines, and the CPU is 32-bit (for simplicity). Now, if the CPU makes a read request and sends a 32-bit address, but it only needs 8 bits, are all 32 bits returned anyway? Also, addresses in memory are still addressing every byte correctly? So, fetching one byte will return 0000 0001 for address 0000 0004?

+6
assembly x86 memory models
source share
2 answers

In general, yes. Nothing happens when reading parts of a word from a bus, so the whole word is read. The instructions indicate which parts of the words they need to actually load or store in registers.

However, this is rarely read directly from memory these days. Processors have caches with which you interact in 99% of cases, and when the data is not in the cache, a whole line (a few words) appears, and then you still read from the cache.

Also note that many modern processors actually have 64-bit buses.

+8
source share
+2
source share

All Articles