|
-
Aug 23rd, 2005, 09:16 AM
#1
Word vs DWord: The 4 byte question :D
I always get confused over this one.
I am pretty sure that a 32-bit CPU's instruction word length is 4 bytes 
Therefore, I would expect a 4-byte data variable to be referred to as a word.
However, (maybe there is some history here from Windows) it always seems to be called a DWord. In ASM code too I see things like
So, can anyone help me out here? For once and for all, what is a word, and what therefore is a DWord, in general computing, and assembly language? Ignoring completely the Win32 API.
-
Aug 23rd, 2005, 09:27 AM
#2
Re: Word vs DWord: The 4 byte question :D
Well... this is a rather odd one! Strictly speaking a Word should be 32 bits, but:
 Originally Posted by Wikipedia: Word (computer science)
The most common microprocessors used in personal computers have the IA-32 architecture (for instance, the Intel Pentiums and AMD Athlons). This architecture is an extension of the original Intel 8086 design which had a word size of 16 bits. The IA-32 processors still support 8086 programs, so the meaning of "word" in the IA-32 context was not changed, and is still said to be 16 bits, despite the fact that they may in actuality operate more like a machine with a 32 bit word size.
And a DWord:
 Originally Posted by Wikipedia: DWord
In computer science, a dword is a unit of data that is twice the size of a word. On the x86 platform, this unit of data would be 32 bits.
You can see the byte sizes (but no definition) at: http://msdn.microsoft.com/library/de...masm_dword.asp
-
Aug 23rd, 2005, 09:32 AM
#3
Re: Word vs DWord: The 4 byte question :D
Right..... so "word=2 bytes" is a holdover from the 16-bit architecture, despite the fact that an actual word size is actually 32-bits... 
Sounds like Microsoft designed the IA-32 architecture
-
Aug 23rd, 2005, 09:39 AM
#4
Re: Word vs DWord: The 4 byte question :D
I think it was probably Intel, all in the name of backwards compatability..
I wonder if it's the same for 64bit processors?
-
Aug 23rd, 2005, 09:47 AM
#5
Re: Word vs DWord: The 4 byte question :D
I haven't found any specifics on this for the 64-bit architectures IA64 and AMD64.
According to all the techinical resources on CPUs I find, a word size is most definitely 4 bytes for IA32 and 8 bytes for IA64/AMD64, being 64-bit. But how they are actually referred to in practice, I couldn't find.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|