Defining Types of Data ?
The subsequent format is used for defining data definition:
Format for data definition:
{Name}
Name - a program references the data item through the name though it is non-compulsory.
Directive: Specifying data type of assembly.
Expression: Signify a value or evaluated to value.
All directives are listed below:
Directive Description Number of Bytes
DB Define byte 1
DW Define word 2
DD Define double word 4
DQ Define Quad word 8
DT Define 10 bytes 10
DUP Directive is used to duplicate the fundamental data definition to 'n' number of times.
ARRAY DB 10 DUP (0)
In the above statement ARRAY is the name of data item that is of byte type (DB). This array comprises 10 duplicate zero values which is 10 zero values.
EQU Directive is used to define a name to a constant
CONST EQU 20
Kinds of number employed in data statements can be Binary, octal, decimal, Hexadecimal and ASCII. Above statement states a name CONST to a value 20.
Some other instances of employing these directives are:
TEMP DB 0111001B ; Binary value in byte operand
; named temp
VALI DW 7341Q ; Octal value assigned to word
; variable
Decimal DB 49 ; Decimal value 49 contained in
; byte variable
HEX DW 03B2AH ; Hex decimal value in word
; operand
ASCII DB 'EXAMPLE' ; ASCII array of values.