Q1:

What is the different between "sizeof AA" and sizeof (AA)"?

Q2:

What is the different between "LOCAL A,B,C:ps"and
"LOCAL A:ps
LOCAL B:ps
LOCAL C:ps"

Q3:

Why "A FLOAT -1.0f" is Wrong while "A REAL4 -1.0f" is RIGHT?(in .data)

Q4:

Can I write code like follow:

".data
some data define
.code
some exec code
.data
some data define more
.code
some other code........"

If I can ,than how ml.exe orgnise my .data and .code section?

Thanks for your reply!
Posted on 2002-05-27 08:06:37 by purefiring
Q1: I don't think there's any difference between "sizeof xyz" and "sizeof (xyz)"

Q2: I'm not sure...assuming masm doesn't default to e.g. DWORD for a local variable without a "qualifiedtype" then the way you've written it should produce three variables of type "ps"
the same thing could be achieved with "local A[3]:ps"

Q3: MASM does not have a FLOAT directive. It does have REAL4,REAL8,REAL10 and a few others

Q4:Yes masm will group all .data sections in your source code to a common data section in the executable...likewise for the .code sections
Posted on 2002-05-27 08:41:39 by MArtial_Code
This is the syntax for LOCAL directly from the old MASM help file,

LOCAL name [][:qualifiedtype] [, name [] [:qualifiedtype]]...

In most instances is clearer to write single lines with LOCAL in a procedure.

Unless Ps is an abbreviation for a LOCAL which is a PAINTSTRUCT, its not a MASM data type and will generate an error.

Regards,

hutch@movsd.com
Posted on 2002-05-27 08:54:57 by hutch--
For Q1:
I've received a error message for use sizeof (AA),but when I changed it into sizeof AA,Then ml works well

For Q3:
I've defined
A Float 1.0f

It woks well,but when I use
A Float -1.0f

Then It makes a error
Posted on 2002-05-28 22:42:59 by purefiring
Question 1:

Post your two source lines with and without the ()'s. I've seen both compile, so it must be in how your implementing it. However, i personally always leave out the brackets...

Question 3:
A dq 1.0
B dq -1.0


Now wasnt that easier ;) . DQ -> Define QuadWord, or 8 byte (64bit) double precision float (a.k.a. Real8). This is not a C++ compiler, so dont try and make it such...

:alright:
NaN
Posted on 2002-05-29 10:08:02 by NaN


float textequ <REAL4>
A REAL4 -1.0
B float -1.0
Posted on 2002-05-29 10:12:45 by f0dder