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

后端 未结 9 918
清歌不尽
清歌不尽 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:32

    WORD is a Windows specific 16-bit integer type, and is hardware independent.

    If you mean a machine word, then there's no need to shout.

    0 讨论(0)
  • 2021-02-02 14:36

    A "word" in small letters depends on the architecture.

    A "WORD" in capital letters, as defined in Windows SDK, is 16 bits.

    Similarly: "DWORD" - (double word) 32 bits. "QWORD" ... 64 bits.

    0 讨论(0)
  • 2021-02-02 14:39

    A word is typically the "native" data size of the CPU. That is, on a 16-bit CPU, a word is 16 bits, on a 32-bit CPU, it's 32 and so on.

    And the exception, of course, is x86, where a word is 16 bit wide (because x86 was originally a 16-bit CPU), a DWORD is 32-bit (because it became a 32-bit CPU), and a QWORD is 64-bit (because it now has 64-bit extensions bolted on)

    0 讨论(0)
提交回复
热议问题