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?

- 90,663
- 31
- 146
- 203

- 11,029
- 17
- 55
- 62
-
1In winapi speak, word is still fixed to 16-bit Windows and thus 16-bit, even on architectures with a large machine size. So in general in Windows HLL programs, word is 16-bit, so it is definitely context sensitive. As Guffa already says, the same 16-bittisms still exist in x86 assembler. – Marco van de Voort May 24 '15 at 20:35
9 Answers
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.

- 687,336
- 108
- 737
- 1,005
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)

- 243,077
- 51
- 345
- 550
-
2
-
2@selurvedu Old comment, but for people who may come across this in the future; you likely can. Intel processors tend to have 64-bit MMX registers which enable you to use QWORDs and you can always read/write 64-bits of data to/from memory (keeping endianness in mind). – Some Guy May 05 '17 at 14:26
-
With regard to @SomeGuy's point about endianness, [this post](https://stackoverflow.com/q/7865511/2636454) is helpful in understanding that. – GDP2 Jul 25 '17 at 06:14
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...

- 41,948
- 7
- 88
- 128
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.

- 48,893
- 5
- 92
- 171
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.

- 64,368
- 4
- 48
- 59

- 5,984
- 2
- 38
- 55
-
1In 8-bit land, we would never have said word when we meant byte. A common definition of word has been simply "two bytes", even on systems with 9-bit bytes and 18-bit words. The PDP-10 comes to mind there... – RBerteig Mar 07 '09 at 11:13
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.

- 17,166
- 1
- 38
- 51
-
Someone missing a sense of humour, or have to get rid of reputation points? Have fun, either way. – Pontus Gagge Mar 07 '09 at 11:04
-
The PDP-11 had 16-bit words. The PDP-10 (DEcSystem-10) had 36-bit words. I'm not aware of a DEC architecture with 40-bit words, but they had so many! – Mar 07 '09 at 11:06
-
PDP-11's (at least those running RT-11, but I think it was used in other DEC OSs also) did use a strange character set known as Rad50 that allowed a 6.3 file name to fit in three words, with three characters per word. DEC liked quirky data packing ;-) (I have a running PDP-11 in my office.) – RBerteig Mar 07 '09 at 11:11
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.

- 1,953
- 1
- 14
- 20