.DW [expression [,[expression [,...]]
The .DW directive is used to enter words only and is meant to add some compatibility with other assemblers in the market.
Operation of the .DW directive is almost the same as the DW directive found in most assemblers.
Personally I prefer the use of the more powerful .DA directive.
Porting existing software to the SB-Assembler will become a little easier with this directive.
In Version 3 of the SB-Assembler this directive will not perform a boundary sync.
Every expression following the .DW directive will be evaluated and only the lower 16 bit value of the result is stored in the target file.
The order in which the bytes are stored depends on the loaded Cross Overlay.
Some processors prefer to have the lowest byte of a pair stored first, others want the highest byte stored first.
So please refer to the description of the particular Cross Overlay to see in what order the bytes are stored.
The default order, when no Cross Overlay is loaded, is lowest byte first. This is also known as little endian model.
Multiple expressions should be separated by commas.
Be sure to load the appropriate Cross Overlay before using the .DW directive! Otherwise the first data words may be saved in the wrong order (wrong endian model).
I have also included the .DB directive to improve the compatibility of byte definitions with other assemblers.
0000-34 12 .DW $1234 Notice the byte order 0002-7C 00 .DW 5+$80-%1001 A more complex expression 0004-34 12 78 56 .DW $1234,$5678 Multiple expressions