Re: "TYPEDEF PTR with STRUCT" masm32
- From: spamtrap@xxxxxxxxxx
- Date: Sat, 14 Oct 2006 13:41:51 -0500
On Sat, 14 Oct 2006 01:50:05 -0500, "Ratch" <spamtrap@xxxxxxxxxx>
wrote:
<snip>
Actually, AFAIK, it makes no difference where a structure or typedef
Don't define your structure within a .DATA? or .DATA segment.
is.
I never use TYPEDEFs.They have thier uses.
I never try to initialize structure items within a STRUCTWhat's so hard about:
statement even though MASM says you can do so.
varname myStrc <>
or
varname myStrc <1,2>
?
In any case, the OP wasn't initalizing the structure.
It is easier to use DWORD,And hope you remember to change it's size when you change the struct.
WORD, and BYTE within a .DATA? or .DATA segment to make space for the
structure, and then use the structure as a template.
Be careful using single or double letter labels for structure items, because a lot of themTrue to some extent.
are reserved words.
You changed the meaning of the code, my example didn't.
myStrc STRUCT
ABC DWORD ?
DEF DWORD ?
myStrc ENDS
; lpMyStrc TYPEDEF PTR myStrc
.DATA?
BYTE 10 DUP (?)
yourstruc BYTE myStrc DUP (?)
.CODE
LEA EDX,OFFSET yourstruc--
push eax
push ebx
mov eax, [EDX.myStrc.ABC]
mov ebx, [yourstruc.myStrc.DEF]
mov [yourstruc.myStrc.ABC], ebx
mov [yourstruc.myStrc.DEF], eax
pop ebx
pop eax
ArarghMail610 at [drop the 'http://www.' from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html
To reply by email, remove the garbage from the reply address.
.
- References:
- "TYPEDEF PTR with STRUCT" masm32
- From: spamtrap
- Re: "TYPEDEF PTR with STRUCT" masm32
- From: Ratch
- "TYPEDEF PTR with STRUCT" masm32
- Prev by Date: Re: Inject asm in a .bat header to run itself backgroud?
- Next by Date: Sending/returning values to MFC/Microsoft functions
- Previous by thread: Re: "TYPEDEF PTR with STRUCT" masm32
- Next by thread: Sending/returning values to MFC/Microsoft functions
- Index(es):
Relevant Pages
|