ENUM             Define enumerated type                             Directive

ENUM name [enum_var [,enum_var...]] ; Ideal mode
name ENUM [enum_var [,enum_var...]] ; MASM mode

Declares an enumerated data type. The syntax of each enum_var is:

var_name [=value]

An enumerated data type represents a collection of values that can be
stored in a certain number of bits. The maximum value stored
determines the actual number of bits required.

Turbo Assembler will assign a value equal to that of the last variable
in the list plus one if =value isn't present when you assign the
specified value to the variable var_name. Values can't be relative or
forward-referenced.

Enumerated data types are redefinable. Variables created with ENUM are
redefinable numeric variables of global scope.

Example: ENUM corners north, east, south, west
ENUM fkeys f1 = 3bh, f2, {
f3, f4
f8 = 42h, f9
f10, f11, f12 }

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 an enum

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

Enumerated data type instances are always either a byte, a word, or a
doubleword, depending on the maximum value present in the definition.

Examples: direcs corners south ; Initialized to south
direc2 corners 315 ; Value outside fits OK
direc3 corners ? ; Uninitialized