← Back to context

Comment by poincaredisk

4 hours ago

A bit is either a 0 or 1. A byte is the smallest addressable piece of memory in your architecture.

Technically the smallest addressable piece of memory is a word.

  • I don't think the term word has any consistent meaning. Certainly x86 doesn't use the term word to mean smallest addressable unit of memory. The x86 documentation defines a word as 16 bits, but x86 is byte addressable.

    ARM is similar, ARM processors define a word as 32-bits, even on 64-bit ARM processors, but they are also byte addressable.

    As best as I can tell, it seems like a word is whatever the size of the arithmetic or general purpose register is at the time that the processor was introduced, and even if later a new processor is introduced with larger registers, for backwards compatibility the size of a word remains the same.

  • Depends on your definition of addressable.

    Lots of CISC architectures allow memory accesses in various units even if they call general-purpose-register-sized quantities "word".

    Iirc the C standard specifies that all memory can be accessed via char*.

Which … if your heap always returns N bit aligned values, for some N … is there a name for that? The smallest heap addressable segment?