Crossware

Table of Contents        Previous topic       Next topic       

ASSEMBLER DIRECTIVES->Other Assembler Directives->DEFW

DEFW  Define Word

This directive inserts a series of double byte values into the object code. The format is:

       DEFW [Exprn],[Exprn],[Exprn],....

The expressions are sequentially evaluated and the two byte values generated are stored sequentially in the program object code.  The low byte is stored first (ie at the lowest address) and the high byte is stored second. As with DEFB, if an expression is null (nothing is written between the commas or before the first comma) then zero is assigned.

Example:

   1                              nam     defwxampl   l
   2                              ttl     define word
   3 79F1               variable  equ     $79F1       
   4 0000 00 00 32 91   label     defw    ,$9132,,variable,$16
     0004 00 00 F1 79
     0008 16 00