Is there some trick to defining local data? :tongue:

I keep getting an error (Invalid value error) when I try and include
a struct as a local. Normal types dont seem to have this problem...



proc WinMain
wc WNDCLASS
enter

...

invoke RegisterClass, [COLOR=crimson]wc[/COLOR]

...

return


If I remove the wc declaration and make it global the problem resolves
itself out. However I am going to start localizing some of my variables.
Mostly its not a problem but I am sure I am going to need some local
structs.

Since I have yet to see other posts related to this its prolly just me :grin:
Posted on 2002-08-18 21:34:00 by Graebel
check out the tuts I converted it localizes the structures. http://www.asmcommunity.net/board/index.php?topic=7358 Also, try searching the board for stack related threads, it might give you some insights.
Posted on 2002-08-18 21:45:50 by stryker
Yes, I saw your tuts. I have been doing that to some extent.

I was asking, because of what point is there of FASM defining structs if you
cant use thier built in offsets unless they are global? That doesnt make
alot of since to me. Maybe that is the only way it can be done currently.
If so I will gladly take it...
Posted on 2002-08-18 22:35:36 by Graebel
Thanks Stryker =)
I guess we just have different coding styles...

After another closer look at your tut's, I was able to combine my style
with yours and preserve the use of the built in struct functionality all
at the same time. Guess with a bit of help I was able to answer my
own question.

Peace
:alright:
Posted on 2002-08-18 23:02:38 by Graebel
You can define structures the same as everything else in the local stack space. Your problem is of different kind, and it would occur when your defined "wc dd ?" also. This is because you are trying to push the offset of wc on the stack, but there is no x86 instruction able to push that offset on stack, because it's ebp-something. So you should use it like here:


lea eax,[wc]
invoke RegisterClass,eax
Posted on 2002-08-19 03:22:00 by Tomasz Grysztar