At one time (16-bit Windows), these types had different sizes. During the transition to Win32, they all turned out to be 32-bit data types. Thus, DWORD compatible with all of them, at least to some extent.
Contrary to popular belief, assembly language (or at least it can) has types and even fairly fair type safety. For example, think about what happens when you do something like:
mov lpszMenuName[ecx], 0
With lpszMenuName defined as DWORD , the assembler will not accept this because '0' can be byte , a word , a DWORD or (in the 64-bit version of the world) a qword . To make it work, you must add a (essentially) cast type:
mov byte ptr lpszMenuName[ecx], 0
So the assembler knows that you want to write one byte. Alternatively, you can define lpszMenuName as:
lpszMenuName ptr byte
In this case, the assembler will know that it should consider it as pointing to a byte, without explicitly specifying each time.
source share