I'm trying to get a value into one of the variables of my structure with no luck. I think its cuz my syntax is all wrong. Any help appreciated.

_______________________________________
mystruct struct

RXL dword ?
RXT dword ?
RYT dword ?
RYB dword ?

mystruct ends

____________________________________

mov eax,somevalue

mov ebx, offset mystruct
mov .RXL,eax <(here is where i get RXL not defined error)

Thanx

:alright:
Posted on 2001-10-02 17:18:39 by titan
Try...
mov (mystruct ptr ).RXL, eax
there are other ways but... this'll do it
Posted on 2001-10-02 17:23:28 by rafe
Well thanx rafe
It compiled ok but i get a page fault when i launch the window.

Maybe you could post another method.

I find that getting info on proper syntax is the hardest thing.
Posted on 2001-10-02 22:14:16 by titan
You can't try to write to the struct itself. You have to create a variable for the struct. Like this:

str mystruct<?>

And then you must change the code to:

mov eax,somevalue

mov ebx, offset str ;See this?
mov .RXL,eax

Do you get it?
Posted on 2001-10-03 01:09:05 by gliptic
fixed the line & not the code :( sorry. As per gliptic's more helpful post... the "struct" works analogous to c's struct. the field defs are nothing more than a convenient notation for offset & size scoped to a variable definition. The "?" marks indicate "don't init the space. think of them as scoped constants that you have to use elsewhere in a variable.

Bad rafe! Now one hundred times!
I will think before I post.
I will think before I post.
I will...
Posted on 2001-10-03 10:16:16 by rafe
Sorry guys but i get an error when i try to use this in uninitialized
data

str mystruct<?>

error "str"
Posted on 2001-10-03 21:40:45 by titan
U can use

str1 mystruct <?>
Posted on 2001-10-03 21:57:06 by buliaNaza
Titan,

About 8 months ago, on the old board, someone posted this question... I made a tutorial-like reply that took you from beging and step by step talked about bigger and better uses.

Im positive you'll find it informative. (I liked it so much i decieded to rip it and post in on my web page!)

You can read it Here, in NaN's discussions :)


:alright:
Hope this helps..
NaN
Posted on 2001-10-03 23:12:16 by NaN
Thanx NaN

Ive been reading it over and i'm getting an idea of what a structure actually is. I was way off base. No C knowledge can do that.




:alright:
Posted on 2001-10-05 23:01:39 by titan