III.11 Macro Processing
Macros allow to combine basic assembler instructions to "super commands".
For this, macros are defined as blocks of code, which can be used in a
program, wherever it is desired.
However, an advanced macro design with parameters, local symbols and macro
operators, combined with conditional assembly, goes far beyond this basic
With only five keywords (MACRO, REPT, ENDM, EXITM, LOCAL) and some control
characters the ASEM-51 macro processor provides a variety of powerful
tools. These five meta instructions are not part of the Intel MCS-51
assembly language, but overlay it, as already known from conditional assembly.
There are two sorts of macros: callable macros and repeat blocks.
- Simple Callable Macros
- Macro Parameters
- Repeat Macros
- Local Symbols
- Macro Operators
- Premature End of a Macro Expansion
- Nested and Recursive Macro Calls
- Nested Macro Definitions
- Representation in the List File