.DA [# | / | = | \] expression [,[# | / | = | \] expression [,...]]
.AS .AT .AZ .DB .DL .DR .DW .HS .RF .TS
The .DA directive is used to enter bytes and words of data into the target code. The data is entered as one or more expressions, separated from each other by commas.
In Version 3 of the SB-Assembler this directive will not perform a boundary sync.
Every expression following the .DA directive will be evaluated and the lower 16 bit value of the result is stored in the target file.
The order in which the bytes of a 16 bit word 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.
The .DA directive can also be used to store single bytes in the target file. To store single bytes the expression must be preceded by one of the following symbols:
# | Stores the lowest byte of the 32 bit result (b0..b7) |
/ | Stores the 2nd lowest byte (b8..b15) |
= | Stores the 2nd highest byte (b16..b23) |
\ | Stores the highest byte (b24..b31) |
The lowest 16 bits are stored if none of these prefixes is used.
Data bytes and words can be mixed together on the same .DA directive line. Multiple expressions should be separated by commas.
I have included the .DR directive for those cases where you need the opposite endian model.
Be sure to load the appropriate Cross Overlay before using the .DA directive! Otherwise the first data words may be saved in the wrong order (wrong endian model).
0000-09 53 7B 23 0004-61 E1 .DA #%1001,#@123,#123,#$123,#'a',#"a" 0006-78 .DA #$12345678 0007-56 .DA /$12345678 0008-34 .DA =$12345678 0009-12 .DA \$12345678 000A-34 12 .DA $1234 Notice the byte order 000C-7C .DA #5+$80-%1001 Some math can be done too 000D-34 12 56 .DA $1234,#$56 Mixed words and bytes