Initialization of Scalar Types

A scalar data item represents a numeric quantity that may be increased or decreased in magnitude as a single unit. Thus, an Initializer expression for a scalar data item must be coded such that it resolves to a single scalar value. See the section on Scalar-Initializer-ExpressionType for the syntax and semantics of such expressions.

The old-style allocation directives (DB, DW, DD, DF, DQ, and DT) are supported in all assembler emulation modes, but for modes other than M510, the Scalar-TypeName keywords should be used instead.

When the Scalar-TypeName keywords are used instead of the old-style allocation directives, the assembler has full knowledge of the data types of the variables being created. This allows the assembler to make more intelligent code generation decisions, and it enables the assembler to correctly describe the variable in the symbolic debugging information that it generates for the source level debugger. Scalar-TypeNames may not be used as allocation directives in the M510 mode.

To allocate an uninitialized scalar data item, use the Indeterminate-Value-Alias ($) in the Initializer field.

┌─────────┬────────────────────┬────────────────────────────────────────┐
│Type Name│Data Type           │Initializer Description                 │
├─────────┼────────────────────┼────────────────────────────────────────┤
│DB, BYTE,│Allocates 8-bit     │Each Initializer must be in the range   │
│or SBYTE │(byte) values.      │from 0 to 255 (unsigned) for a DB or    │
│         │                    │BYTE directive, and from -128 to 127    │
│         │                    │(signed) for a SBYTE directive.         │
├─────────┼────────────────────┼────────────────────────────────────────┤
│DW, WORD,│Allocates 16-bit    │Each Initializer must be in the range   │
│or SWORD │(word) values.      │from 0 to 65535 (unsigned) for a DW or  │
│         │                    │WORD directive, and from -32768 to 32767│
│         │                    │(signed) for a SWORD directive.         │
├─────────┼────────────────────┼────────────────────────────────────────┤
│DD,      │Allocates 32-bit    │If the Initializer is an integer, each  │
│DWORD, or│(double-word)       │must be in the range from 0 to          │
│SDWORD   │values.             │4,294,967,295 (unsigned) for a DD or    │
│         │                    │DWORD directive, and from -2,147,483,648│
│         │                    │to 2,147,483,647 (signed) for a SDWORD  │
│         │                    │directive.  If the DD directive is being│
│         │                    │used, an Initializer may also resolve to│
│         │                    │a 32-bit Floating-Point-ExpressionType. │
├─────────┼────────────────────┼────────────────────────────────────────┤
│DF or    │Allocates 48-bit    │Each Initializer typically specifies the│
│FWORD    │(6-byte far-word)   │full address of a 32-bit far code or    │
│         │values.             │data label, but normal 32-bit integer   │
│         │                    │values may also be used.  The processor │
│         │                    │does not support 48-bit integer         │
│         │                    │operations, thus the assembler does     │
│         │                    │support 48-bit integer precision when   │
│         │                    │initializing such variables.  These     │
│         │                    │directives are typically only useful for│
│         │                    │defining pointer variables for use on   │
│         │                    │32-bit processors.                      │
├─────────┼────────────────────┼────────────────────────────────────────┤
│DQ or    │Allocates 64-bit    │Both DQ and QWORD allow an integer      │
│QWORD    │(quad-word) values. │Initializer with 64-bit (8-byte)        │
│         │                    │precision.  If the DQ directive is being│
│         │                    │used, the Initializer field may resolve │
│         │                    │to a 64-bit                             │
│         │                    │Floating-Point-ExpressionType.          │
├─────────┼────────────────────┼────────────────────────────────────────┤
│DT or    │Allocates 80-bit    │Both DT and TBYTE allow an integer      │
│TBYTE    │(10-byte) values    │Initializer with 80-bit (10-byte)       │
│         │                    │precision.  If the DT directive is being│
│         │                    │used, the Initializer field may resolve │
│         │                    │to a 80-bit                             │
│         │                    │Floating-Point-ExpressionType.          │
├─────────┼────────────────────┼────────────────────────────────────────┤
│REAL4,   │Allocates real      │Each Initializer must resolve to a      │
│REAL8, or│(floating-point)    │Floating-Point-ExpressionType.  The     │
│REAL10   │values of a specific│assembler converts the floating-point   │
│         │size (4 bytes, 8    │literal to the IEEE format appropriate  │
│         │bytes, or 10 bytes).│for the type of variable being          │
│         │                    │allocated.                              │
└─────────┴────────────────────┴────────────────────────────────────────┘