System information
3.4.6 The DB Directive
The DB directive allows the programmer to define initialized storage areas in singleprecision
byte format. The DB statement takes the form:
label DB e#1, e#2, ... , e#n
where e#1 through e#n are either expressions that evaluate to 8-bit values (the highorder bit must
be zero) or are ASCII strings of length no greater than 64 characters. There is no practical
restriction on the number of expressions included on a single source line. The expressions are
evaluated and placed sequentially into the machine code file following the last program address
generated by the assembler. String characters are similarly placed into memory starting with the
first character and ending with the last character. Strings of length greater than two characters
cannot be used as operands in more complicated expressions.
Note:ASCII characters are always placed in memory with the parity bit reset (0). Also, there is
no translation from lower- to upper-case within strings. The optional label can be used to
reference the data area throughout the remainder of the program. The following are examples of
valid DB statements:
data: DB 0,1,2,3,4,5
DB data and 0ffh,5,377Q,1+2+3+4
sign-on: DB 'please type your name',CR,LF,0
DB 'AB' SHR 8,'C','DE',AND 7FH
3.4.7 The DW Directive
The DW statement is similar to the DB statement except double-precision two-byte words of
storage are initialized. The DW statement takes the form:
label DW e#1, e#2, ..., e#n
where e#1 through e#n are expressions that evaluate to 16-bit results. Note that ASCII strings of
one or two characters are allowed, but strings longer than two characters are disallowed. In all
cases, the data storage is consistent with the 8080 processor; the least significant byte of the
expression is stored first in memory, followed by the most significant byte. The following are
examples of DW statements:
doub: DW 0ffefh,doub+4,signon-$,255+255
DW 'a',5,'ab','CD',6 shl 8 or llb.
3.4 Assembler Directives CP/M Operating System Manual
3-15