I noticed unknown to me thing,
for using invoke and checking args with it, it's not always necessary to write proto.
Enough if the function is written before invoke.
Posted on 2002-05-15 03:32:10 by The Svin
Alex,

Thats normal in MASM but it makes your procedures order dependent with no advantage in size or speed. I routinely write all of my prototypes before the code so that I can order my code any way I like.

Regards,

hutch@movsd.com
Posted on 2002-05-15 03:51:21 by hutch--
Unfortunatly the is no (at least known to me) proto about data :)
MASM doesn't like it to be forward.
What about local lables. I found the only way out (before I used
lbl = $ but in long source it is not comfortable) to use fool proc statments since lables declared within it unseen to other code.
Posted on 2002-05-15 04:02:36 by The Svin
Alex,

I have never found problems with data reference, MASM does not allow forward reference but you can get around it in a number of ways, write the data you need directly in the code section if its read only, locally write it to the DATA or DATA? sections with,


.data?
your_variable dd ?
.code

If you need to be able to modify it.

The only gripe I have with MASM is not being able to write on the fly LOCAL variables in a procedure, they must always be at the top which is a pain. This capacity would make a number of code designs easier to use.

Regards,

hutch@movsd.com
Posted on 2002-05-15 06:07:41 by hutch--
Well, I use it frequently in this way you showed,
that is exactly what being handy to use (I mean the ability to put any section data in any part of source) at the same create a problem 'cause if I write:

mov eax,somedata ;1
push ecx
.data?
somedata dd ?
.code
pop ebx
inc somedata ;2
Line marked 2 is not a problem for masm, but about line marked 1
it says it can't find it.

PS. Want to thank you for L2EXTIA.EXE and the method.
I created the same thing (extcalls) my way and it was less comfortable and more time consuming.
Posted on 2002-05-15 06:15:28 by The Svin
I probavly haven't got it quite right, but doesn't the assembler
take all the .DATA sections and put them all together in a data
segment starting wherever the first .DATA section is? This way at
least you can declare non-local variables sort of on the fly, right?
And not worry about the eds register getting all confused?
Posted on 2002-05-15 10:36:42 by Bighillwill