Crossware

Table of Contents        Previous topic       Next topic       

ASSEMBLER DIRECTIVES->Other Assembler Directives->DW

DW        Define Word


The DW data directive is used to create constant data.  Tables, text and numerical data for instance can be created using DW.

Constants are placed in words (16 bits) and, if necessary, numeric data is truncated to fit into a single word.

Note that the arrangement in memory of the two bytes of each word is with the high byte first (ie at the lower address) followed by the low byte.

Multiple constants can be created with a single DW directive by including more than one expression in the operand.  Adjacent expressions are separated from each other by commas.  Up to 256 bytes of data can be generated with a single directive.


Format:

<label>              DW        <expression>,<expression>.....  <comment>