RECORD           Define record type                                 Directive

RECORD recordname [rec_field [, rec_field ...]] ; Ideal mode
recordname RECORD [rec_field [, rec_field ...]] ; MASM mode

Declares a record data type. Each rec_field describes a group of bits
in the record and has the following syntax:

field_name : width_expr [=value]

field_name is the name of a record field. TASM will allocate a bit
field of the width width_expr for it. =value describes the initial
value of the field (the default value used when an instance of the
record is created). Values and width expressions cannot be relative or
forward-referenced. Record field names are global in scope and
cannot be redefined.

You can redefine record data types, and define the same name as a
record data type more than once in a module.

Examples: RECORD switches s1:1,s2:1,s3:4
RECORD myrec val:3=4, {
mode:2
sze:4=15 }

Turbo Assembler provides special support for record fields that
represent flags and enumerated data types (see GETFIELD, SETFIELD,
MASKFLAG, SETFLAG, TESTFLAG, FLIPFLAG).


Creating an instance of a record

You can create an instance of a record data type by using the name of
the record data type as a data allocation directive.

Record instances are always either a byte, a word, or a doubleword,
depending on the number of bits allocated in the definition.

Examples: rtest1 myrec ? ; uninitialized
rtest2 myrec < > ; initialized to defaults
rtest3 myrec { } ; initialized to defaults
which is equivalent to:
DW (4 SHL 6) + (0 SHL 4) + (15 SHL 0)
rtest4 myrec {mode=2, sze=?} ; initialize named fields
rtest5 myrec <,2,?> ; = rtest4