Results 1 to 5 of 5

Thread: Word vs DWord: The 4 byte question :D

  1. #1

    Thread Starter
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Arrow 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
    Code:
    mov dword ptr xxx
    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.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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:
    Quote 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:
    Quote 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

  3. #3

    Thread Starter
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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?

  5. #5

    Thread Starter
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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
  •  



Click Here to Expand Forum to Full Width