News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Data Types

Started by Astro, July 06, 2009, 01:32:41 AM

Previous topic - Next topic

Astro

Hi,

.DATA
ClassName db "SimpleWinClass",0        ; the name of our window class
AppName db "Our First Window",0        ; the name of our window


What is "db"? Double Byte? Where can I find the different types?

Something else I don't quite get (example ripped out of windows.inc):

HENHMETAFILE                typedef DWORD
HFILE                       typedef DWORD
HFONT                       typedef DWORD
HGDIOBJ                     typedef DWORD
HGLOBAL                     typedef DWORD

Are all these interchangable as they are the type DWORD?

e.g.

could:

HANDLE myHandle

equally be:

HGLOBAL myHandle

without any problems? (Although, yes, it would make reading the code a complete nightmare!!!!).

In other words, isn't there any siginificance except to make the code more readable?

dedndave

 "db" = Define Byte
dw word
dd dword
dq dairy queen - ooops - qword (quadword)

as for the windows.inc file - that is the standard windows include file for the windows API's
best not to use those names, as they are used in structures, pins, etc for windows API's

as an example, NULL is equal to 0 - it is defined in windows.inc
there are other values in there that also are equal to 0, but they are defined for clarity and to match the API reference manuals

Mark Jones

Hi, check out this file: \masm32\help\asmintro.chm. It is essential and very brief, and will answer most initial questions.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

disintx

1. db means 'define byte'.
Others include:
dw - define word (two bytes)
dd - define double word (four bytes)
dq - define quadword (8 bytes)
dt - define 10 bytes - never really seen this used but I'm 99% certain this is real..maybe someone will verify

2. What that means is just that each of those values are 4 bytes long (double word). Generally they're
pointers (4-byte address) to where the actual value/junk is stored in memory.
They "are interchangeable", but they are obviously all different values when you're receiving them. You COULD
do what you're saying but it would just be confusing. :)

edit: dave beat me to it :|

Astro

Thanks!!!  :8)

I'll check out that CHM file.

EDIT: PERFECT!!!!  :eek

dedndave

disintx - lol - good you were there - i forgot dt
it is used for 80 bit floats

disintx

Quote from: dedndave on July 06, 2009, 02:11:07 AM
disintx - lol - good you were there - i forgot dt
it is used for 80 bit floats
Ah yes :)