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

后端 未结 9 917
清歌不尽
清歌不尽 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...

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

    16 bits (2 bytes) to a word is universal for x86.

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

    My understanding is that a WORD is the amount of bits that can be shoved into the CPU with one action (on a particular machine), so in a 8bit-architecture it is 8 bits and on a modern 64-bit architecture it is 64 bits.

    0 讨论(0)
  • 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.

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

    It depends upon the machine architecture. This document explains some basics about this.

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

    All you youngsters yappin' on about 32 bit thiss and 64 bit that: you know, there were and are other machine architectures than the x86 family. A PDP-11 had 40-bit words, f'rinstance.

    But the simplest answer is just to search Wikipedia.

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