Monday, April 25, 2016

What is Data Segment? With Example

Data Segment : A program's data segment contains all the variable definitions. Constant definitions are often made here as well, but they may be placed elsewhere in the program since no memory allocation is involved. To declare a data segment, we use the directive. DATA, followed by variable and constant declarations.

Example :

.DATA                  DW 2
WORD1                DW 5
WORD2                DB 'THIS IS A MESSAGE'
MASK                   EQU 10010010B

No comments:

Post a Comment