In this example, the HASM reserves byte location 0 for tbuf, location 1 for
chksum, bit 0 of location 3 for flag1, location 4 for sbuf and bit 1 of location
3 for cflag.
→
Syntax
name
EQU
expression
•
Description
The EQU directive creates absolute symbols, aliases, or text symbols by
assigning an expression to name. An absolute symbol is a name standing
for a 16-bit value; an alias is a name representing 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 integer, a string constant, an instruction mnemonic, a constant expres-
sion, or an address expression.
•
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.
Macro directives
Macro directives enable a block of source statements to be named, and then
that name to be re-used in the source file to represent the statements.
During assembly, the assembler automatically replaces each occurrence of
the macro name with the statements in the macro definition.
A macro can be defined at any place in the source file as long as the
definition precedes the first source line that calls that macro. In the macro
definition, the macro to be defined may refer to other macros which have
been previously defined. The HASM supports a maximum of 7 nesting
levels.
The syntax of a macro definition is as follows:
name
MACRO [dummy-parameter [, ...]]
statements
ENDM
The assembler supports a directive LOCAL for the macro definition. Its
syntax is
LOCAL dummy-name [, ...]
Chapter 10 Assembly Language and Cross Assembler
125
Содержание HT-IDE
Страница 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Страница 12: ...HT IDE User s Guide 2 ...
Страница 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Страница 24: ...HT IDE User s Guide 14 ...
Страница 70: ...HT IDE User s Guide 60 ...
Страница 76: ...HT IDE User s Guide 66 ...
Страница 92: ...HT IDE User s Guide 82 ...
Страница 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Страница 94: ...HT IDE User s Guide 84 ...
Страница 148: ...HT IDE User s Guide 138 ...
Страница 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Страница 154: ...HT IDE User s Guide 144 ...
Страница 192: ...HT IDE User s Guide 182 ...
Страница 194: ...HT IDE User s Guide 184 ...
Страница 218: ...HT IDE User s Guide 208 ...
Страница 235: ...P a r t V Appendix Part V Appendix 225 ...
Страница 236: ...HT IDE User s Guide 226 ...
Страница 250: ...HT IDE User s Guide 240 ...