®
Syntax
[
name
]
DB
value1
[,
value2
[, ...]]
[
name
]
DW
value1
[,
value2
[, ...]]
[
name
]
DBIT
[
name
]
DB
repeated-count
DUP
(?)
[
name
]
DW
repeated-count
DUP
(?)
·
Description
These directives reserve the number of bytes/words specified by the repeated-count or reserve
bytes/words only.
value1
and
value2
should be ? due to the microcontroller RAM . The Cross
Assembler will not initialize the RAM data.
DBIT
reserves a bit. The content ? denotes
uninitialized data, i.e., reserves the space of the data. The Cross Assembler will gather every 8
DBIT
together and reserve a byte for these 8
DBIT
variables.
·
Example
DATA
.SECTION
¢
DATA
¢
tbuf
DB
?
chksum
DW
?
flag1
DBIT
sbuf
DB
?
cflag
DBIT
In this example, the Cross Assembler reserves byte location 0 for
tbuf
, location 1 and 2 for
chksum
, bit 0 of location 3 for
flag1
, location 4 for
sbuf
and bit 1 of location 3 for
cflag
.
®
Syntax
name
LABEL
{BIT
|
BYTE
|
WORD}
·
Description
The
name
with the data type has the same address as the following data variable
·
Example
lab1
LABEL
WORD
d1
DB
?
d2
DB
?
In this example,
d1
is the low byte of
lab1
and
d2
is the high byte of
lab1
.
®
Syntax
name
EQU
expression
·
Description
The
EQU
directive creates absolute symbols, aliases, or text symbols by assigning an
expres-
sion
to
name
. An absolute symbol is a name standing for a 16-bit value; an alias is a name rep-
resenting another symbol; a text symbol is a name for another combination of characters. The
name
must be unique, i.e. not having been defined previously. The
expression
can be an inte-
ger, a string constant, an instruction mnemonic, a constant expression, or an address expres-
sion.
·
Example
accreg
EQU
5
bmove
EQU
mov
In this example, the variable
accreg
is equal to 5, and
bmove
is equal to the instruction
mov
.
Chapter 4 Assembly Language and Cross Assembler
109
Summary of Contents for HT46R22
Page 7: ...vi A D Type MCU...
Page 9: ...viii A D Type MCU...
Page 10: ...P a r t I Microcontroller Profile Part I Microcontroller Profile 1...
Page 11: ...2 A D Type MCU...
Page 90: ...P a r t I I Programming Language Part II Programming Language 81...
Page 91: ...82 A D Type MCU...
Page 97: ...88 A D Type MCU...
Page 128: ...P a r t I I I Development Tools Part III Development Tools 119...
Page 129: ...120 A D Type MCU...
Page 140: ...Appendix Appendix 131...
Page 141: ...132 A D Type MCU...
Page 151: ...142 A D Type MCU...
Page 152: ...A p p e n d i x B Package Information Appendix B Package Information 143 B...
Page 161: ...A D Type MCU...
Page 162: ...Amendments...