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 functionality!
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.

  1. Simple Callable Macros
  2. Macro Parameters
  3. Repeat Macros
  4. Local Symbols
  5. Macro Operators
  6. Premature End of a Macro Expansion
  7. Nested and Recursive Macro Calls
  8. Nested Macro Definitions
  9. Representation in the List File

[contents] [up] [back] [next]