0

Let's say that we have a 3 Bytes long instruction at RAM address 1000 called INS_A. To fetch this entire function the cpu needs to address RAM at 1000, then 1001 and finally 1002 and get each single Byte at these addresses.

I don't understand the role of the "words". Most literature define them as "a group of bytes" or "the size of the registers"....

Can someone give the ultimate answer about the difference between these two "words" and explain practically ( by using a modern intel CPU machine ) what's going on ?

Kode1000
  • 111
  • 3
  • In modern x86, "word" isn't a useful term, other than as the name for a 16-bit thing, as in `movzx eax, word [rdi]` or `cwd`. (Names for wider things are like double-word = dword.) It's not a word-oriented architecture *at all*, so there's no single size that would be appropriate to call the "machine word" size, not in the sense that some CPUs, especially classic RISCs, were oriented around most loads and stores and instruction-fetches being aligned 4-byte words. See the bottom of [What's the size of a QWORD on a 64-bit machine?](https://stackoverflow.com/a/55430777) – Peter Cordes Oct 07 '22 at 21:24
  • Instruction fetch logically happens a byte at a time, but in practice happens in 16 or 32-byte chunks into a buffer that the decode stages of the pipeline pick from. (Usually aligned, but it takes at most two fetches to pull in a complete instruction in anything since maybe Pentium Pro. Max instruction length is 15 bytes) – Peter Cordes Oct 07 '22 at 21:27

0 Answers0