News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Checking a structure field ...

Started by James Ladd, March 09, 2005, 09:17:10 AM

Previous topic - Next topic

James Ladd

I have the following ...


local events:WSANETWORKEVENTS


and I need to see if the iErrorCode element at FD_ACCEPT is zero (0).
eg:  .if iErrorCode[FD_ACCEPT_BIT] == 0


FD_ACCEPT_BIT                   equ 3
FD_MAX_EVENTS                   equ 10
WSANETWORKEVENTS STRUCT
    lNetworkEvents              dd  ?
    iErrorCode                  dd  FD_MAX_EVENTS dup (?)
WSANETWORKEVENTS ENDS


I have tried the following without success ... :(


    mov eax, addr events


and


    mov eax, offset events


I just get MASM errors like invalid operand for offset or syntax error addr.

Your help would be appreciated.

rgs, striker

hutch--

James,

Just use LEA on the LOCAL structure name.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

James Ladd