I have the following question/problem:

Let say we have a structure and i mov the pointer to the structure to a register. Then i can access



.data
MyStruct struct
A WORD ?
B WORD ?
MyStruct ends

MyStruct MyStruct <>

.code
;...
mov eax, offset MyStruct
mov (MyStruct ptr [eax]).B, cx
;...


But the .if cant do..:




mov eax, offset MyStruct
.IF (MyStruct ptr [eax]).B == 0
;Code ...
.ENDIF



So, i need to check manually the size of each member and add it to the register that recives the structure pointer ().
Is there another way?
Posted on 2005-01-31 22:32:58 by Ateneo
MyStruct MyStruct <>

That is very confusing to the assembler. The label for the memory variable should be different from the struct definition.

Depending on the syntax of the assembler you are using, the use of parentheses may also not be necessary.

Raymond
Posted on 2005-01-31 23:21:30 by Raymond