Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Structure Field Reference (.)
                                             Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Syntax:   expression.field[.field]...
 
            expression2.structtype.field[.field]...
 
  See also: STRUCT, OPTION DOTNAME, OPTION OLDSTRUCTS, UNION, RECORD,
            MASM 5.1 Compatibility
 
  Description:
 
     Returns the offset of <expression> plus the value of <field>. This
     operator is usually used to access a field of data within a structure
     or union variable. You can use several dot operators to access nested
     structures.
 
     Parameter      Description
 
     expression1    An expression for which the qualified type is a
                    structure
 
     expression2    An arbitrary expression.
 
     structtype     A defined structure type.
 
     field          A field within a previously defined structure type.
                    Each field has an offset relative to the beginning
                    of the structure.
 
  Example:
 
     DPSTRUCT   STRUCT                          ; Memory-mapped dsp
                ctrlreg         WORD    ?       ;  data structure
                addrreg         DWORD   ?
     DPSTRUCT   ENDS
 
     IOSTRUCT   STRUCT                          ; Set up nested structure
                vio             VIDEOSTRUCT <>  ;  for I/O
                dsp             DPSTRUCT <>     ;
     IOSTRUCT   ENDS
 
     ioInst     IOSTRUCT        <>              ; Instance of IOSTRUCT
 
     lea        ax, (IOSTRUCT PTR [bx]).\       ; Loads offset of
                dsp.ctrlreg                     ;  ctrlreg element of I/O
                                                ;  structure pointed to
                                                ;  by the bx register
 
     assume     bx:PTR IOSTRUCT
     lea        ax, [bx].dsp.ctrlreg            ; Same as above code line
 
     mov        ioInst.dsp.ctrlreg, 10h         ; Set control register to 10
                                    -♦-