How many bits is a WORD and is that constant over different architectures?

后端 未结 9 946
清歌不尽
清歌不尽 2021-02-02 13:37

Is a machine WORD always the same or does it depend on the machine architecture? And is the meaning of the word WORD context sensitive or generally applicable?

9条回答
  •  误落风尘
    2021-02-02 14:20

    Yes.

    Ok, let me be a bit clearer. Assuming we are talking about words of memory, there are two broad definitions.

    First, a word is often the natural size of a single item that can be accessed atomically in the hardware. That is very much a platform dependent size, but is usually 16, 32, or 64 bits, but other sizes have been found in the wild.

    Second, it is often used to specifically mean a 16-bit value. In that context, you will see DWORD used to mean a 32-bit value. This usage is common on x86 platforms, especially Windows, but was used on DEC PDP-11 and VAX, and Motorola 68000 descendants as well.

    Telling which is the intended usage depends on context...

提交回复
热议问题