It's my second question, one after another. That's the problem with assembly (x86 - 32bit) too.

"Programming from the Ground Up" says that 4bytes are 32bits and that's a word.But Intel's "Basic Architecture" guide says, that word is 16bits (2 bytes) and 4 bytes is a dualword. Memory uses 4bytes words, to get to another word I have to skip next 4 bytes, on each word I can make 4 offsets (0-3) to read a byte, so it's wrong with Intel's name, but this memory definition goes from Intel, so what's there bad?

And how to operate on words, dualword, quadwords in assembly? How to define the number as quadword?

2

Best Answer


To answer your first question, the processor word size is a function of the architecture. Thus, a 32-processor has a 32-bit word. In software types, including assembly, usually there is need to identify the size unambigously, so word type for historical reasons is 16-bits. So probably both sources are correct, if you read them in context: the first one is referring to the processor word, while the Intel guide is referring to the word type.

We've got different "word"s: program words, memory words, OS-specific words, architecture-specific words (program space word, flash word, eeprom word), even address words.

It's just a matter of convention what size the word word refers to.

I usually find the size of the word by looking at the number of hex digits the context is using to show them. Intel's most common type, 4 digits (0x0000), is two bytes.

And for further information, even byte is a convention. In many systems in the past bytes have been 7 or 9 bits. Most architectures nowadays have 8-bit bytes. The correct name for an always-8-bit structure is an octet.