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

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

    The machine word size depends on the architecture, but also how the operating system is running the application.

    In Windows x64 for example an application can be run either as a 64 bit application (having a 64 bit mahine word), or as a 32 bit application (having a 32 bit machine word). So the size of a machine word can differ even on the same machine.

    The term WORD has different meaning depending on how it's used. It can either mean a machine word, or a type with a specific size. In x86 assembly language WORD, DOUBLEWORD (DWORD) and QUADWORD (QWORD) are used for 2, 4 and 8 byte sizes, regardless of the machine word size.

提交回复
热议问题