hehe I am not sure if anybody encounter this be4, but I am just wondering what masm actually do:

I have this following decleared in a proc:

example 1:

SomeProc Proc
LOCAL Buffer1:DWORD, Buffer2:DWORD
etc.....

example 2:

SomeProc Proc
LOCAL Buffer1:DWORD, Buffer2

this one is without the :DWORD after Buffer2

but I am able to compile both of them with out any warnings or errors and both works fine :confused:

can someone explain about the example 2?????? :alright:

sincerely,
Posted on 2001-11-03 02:18:55 by Yanda
Yanda,

variable without type seems assumed DWORD.
try
mov Buffer2,eax
should work

mov Buffer2,al
should give compiling error
Posted on 2001-11-03 07:56:28 by Bit7
yeah! I find that out too, but its weird that masm didn't report error on that ^_~

but thankx


sincerely,
Posted on 2001-11-03 14:47:09 by Yanda
Yanda,

You do find quirks like that occasionally, MASM has a few of its own but you should never depend on them, ALWAYS set your data type in a LOCAL variable otherwise you will ebnd up with unreliable code that is hard to debug.

Regards,

hutch@movsd.com
Posted on 2001-11-03 15:08:12 by hutch--
If you look up Local & Proc in the Masm Help file it says that the data size defaults to WORD for 16 bit segments and DWORD for 32 bit (FLAT)segments. It would seem that this is a feature not a quirk.

I use this "feature" all the time. I hate typing :DWORD over & over
Posted on 2001-11-03 17:21:23 by gfalen
hahaha ok ic ic ^_^

well, I guess I betta stick wif Hutch's idea .

thankx for all da replies ^_^


sincerely,
Posted on 2001-11-03 21:55:37 by Yanda