Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to access to struct member?

Status
Not open for further replies.

SL82

Programmer
Jan 25, 2005
1
UA
Please help me.
I need to know how can I access to struct member if I know only struct address.
For example, something like this:

STRUC MY_STRUCT
x dd ?
y dd ?
ENDS MY_STRUCT
...
pop edi ; edi directs to variable of type MY_STRUCT
add edi, offset MY_STRUCT.y

Last string don't want to be compiled.

This problem is terrible for me, because I need to write a program on tasm with classes. I had wrote some non-static methods and have to calculate (by hands) addresses of class members in each methods. It's terrible!
I think, must be a good access method. Am I right?
 
make this:

add edi, offset MY_STRUCT.y

this:

add edi,[MY_STRUCT.Y+edi]

and it will work fine

Tessa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top