Hardware Reference
In-Depth Information
initializes the contents of memory locations at $1000, $1001, $1002, $1003, and $1004 to $11,
$22, $33, $44, and $55, respectively.
dw (define word), dc.w (define constant word), fdb (form double bytes)
These three directives define the value of a word or words that will be placed at a given ad-
dress. The value can be specified by an integer or an expression. For example, the statement
vect_tab dw $1234, $5678
initializes the two words starting from the current location counter to $1234 and $5678, respec-
tively. After this statement, the location counter will be incremented by 4.
fcc (form constant character)
This directive allows us to define a string of characters (a message). The first character
in the string is used as the delimiter. The last character must be the same as the first charac-
ter because it will be used as the delimiter. The delimiter must not appear in the string. The
space character cannot be used as the delimiter. Each character is encoded by its corresponding
American Standard Code for Information Interchange (ASCII) code. For example, the statement
alpha fcc “def”
will generate the following values in memory:
$64
$65
$66
and the assembler will use the label alpha to refer to the address of the fi rst letter, which is
stored as the byte $64. A character string to be output to the LCD display is often defi ned using
this directive.
fill (fill memory)
This directive allows a user to fill a certain number of memory locations with a given
value. The syntax of this directive is as follows:
fill value, count
where the number of bytes to be fi lled is indicated by count and the value to be fi lled is indi-
cated by value . For example, the statement
spaceLine fill $20, 40
will fi ll 40 bytes with the value of $20 starting from the memory location referred to by the
label spaceLine .
ds (define storage), rmb (reserve memory byte), ds.b (define storage bytes)
Each of these three directives reserves a number of bytes given as the arguments to the
directive. The location counter will be incremented by the number that follows the directive
mnemonic. For example, the statement
buffer ds 100
reserves 100 bytes in memory starting from the location represented by the label buffer . After
this directive, the location counter will be incremented by 100. The content(s) of the reserved
memory location(s) is(are) not defi ned.
ds.w (define storage word), rmw (reserve memory word)
Each of these directives increments the location counter by the value indicated in the num-
ber-of-words argument multiplied by 2. In other words, if ds.w evaluates to k , then the loca-
tion counter is advanced by 2k . These directives are often used with a label. For example, the
statement
 
Search WWH ::




Custom Search