.DB [expression | string [,[expression | string [,...]]
The .DB directive is used to enter bytes only and is meant to add some compatibility with other assemblers on the market.
Operation of the .DB directive is almost the same as the DB 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 .DB directive will be evaluated and only the lower 8 bit value of each result is stored in the target file. If you need other bytes of the 32-bit value you can divide the value by $100, $10000 or $1000000.
Instead of an expression you may also enter a string of characters.
Strings must be surrounded by a pair of single or double quotes.
The string may not be empty and must be terminated with the same type of quote as it was opened.
The opening quote may not be present in the string itself because that would terminate the string prematurely.
There is no difference between using a pair of single quotes or a pair of double quotes, unlike with the .AS and .DA directives. This is done to make the directive more compatible with other assemblers.
You can not use a text parameter together with an expression, not even when the text string is only one byte long. So a thing like .DB "T"+$80 is not allowed. There are better alternatives for this, like the .AT directive.
Multiple expressions or strings in the operand field must be separated by commas.
I have also included the .DW directive to improve the compatibility of word definitions with other assemblers.
0000-78 .DB $12345678 Only the LSB is used 0001-7C .DB 5+$80-%1001 Complex expression 0002-12 34 .DB $12,$34 Multiple expressions 0004-54 65 73 74 .DB "Test" Only a string 0008-54 65 73 74 000C-0D 0A .DB 'Test',$0D,$0A A string followed by 2 bytes