.db


Initialization of byte area.

[Syntax]

Symbol field

Mnemonic field

Operand field

Comment field

[label:]
.db
{expression|"string constant"}[, ...]
[; comment]

[Function]

-

The .db directive tells the assembler to initialize a memory area in byte units with the initial value(s) specified in the operand field.

[Use]

-

Use the .db directive when defining an expression or character string used in the program.

[Description]

-

The assembler initializes a byte area with:

(a)

Expression

The value of an expression must be 1-byte data. Therefore, the value of the operand must be in the range of 0x0 to 0xFF. If the value exceeds 1 byte, the assembler will use only lower 1 byte of the value as valid data.

(b)

Character string constants

If an operand is surrounded by double quotes ("), it is assumed to be a string constant.

If a character string constants is described as the operand, an area of appropriate size will be reserved for each character in the string.

 

-

Two or more initial values may be specified within a statement line of the .db directive.

-

As an initial value, an expression that includes a relocatable symbol or external reference symbol may be described.

-

If the relocation attribute of the section containing the .db directive is "BSS", then an error is output because initial values cannot be specified.

[Example]

                .dseg   data
MASSAG:         .db     "ABCDEF"                ; (1)
DATA1:          .db     0xA, 0xB, 0xC           ; (2)
DATA3:          .db     "AB" + 1                ; (3)   <- Error

(1)

A 6-byte area is initialized with character string 'ABCDEF'

(2)

A 3-byte area is initialized with "0xA, 0xB, 0xC".

(3)

This description occurs in an error.