Comment
Comments are the descriptions of codes. They are used for documentation only and are ignored
by the Cross Assembler. Any text following a semicolon is considered a comment.
Assembly Directives
Directives give direction to the Cross Assembler, specifying the manner in which the Cross Assem-
bler generates object code at assembly time. Directives can be further classified according to their
behavior as described below.
Conditional Assembly Directives
The conditional block has the following form:
IF
statements
[
ELSE
statements
]
ENDIF
®
Syntax
IF
expression
IFE
expression
·
Description
The directives
IF
and
IFE
test the
expression
following them.
The
IF
directive grants assembly if the value of the
expression
is true, i.e. non-zero.
The
IFE
directive grants assembly if the value of the
expression
is false, i.e. zero.
·
Example
IF
debugcase
ACC1
equ 5
extern
username: byte
ENDIF
In this example, the value of the variable
ACC1
is set to 5 and the
username
is declared as an
external variable if the symbol
debugcase
is evaluated as true, i.e. nonzero.
®
Syntax
IFDEF
name
IFNDEF
name
·
Description
The directives
IFDEF
and
IFNDEF
test whether or not the given
name
has been defined. The
IFDEF
directive grants assembly only if the
name
is a label, a variable or a symbol. The
IFNDEF
di-
rective grants assembly only if the
name
has not yet been defined. The conditional assembly direc-
tives support a nesting structure, with a maximum nesting level of 7.
·
Example
IFDEF
buf_flag
buffer
DB
20 dup(?)
ENDIF
In this example, the
buffer
is allocated only if the
buf_flag
has been previously defined.
Chapter 4 Assembly Language and Cross Assembler
103
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...