Macroprocessor New
Macroprocessor New
MACROS AND
MACRO PROCESSORS
Overview
Start of definition
Example:
Macro name
A 1,DATA MACRO
A 2,DATA INCR INCR
A 3,DATA A 1,DATA
Repeated Sequence to be
A 2,DATA
code A 3,DATA
abbreviated
A 1,DATA INCR
A 2,DATA MEND
A 3,DATA
End of definition
Ch 3 – Macros and Macro Processors 3/20/2024
Macros in C
#include <stdio.h> #include <stdio.h>
#define Square(x) ((x)*(x)) //Macro definition not included
<model statements>
MEND
Name: Name given for the macro appeareas in mnemonic field of aasembly statement
Formal Parameters: The entries in the operands field identify the parameters of the macro
definition.
Model Statements: the statements that will generate as the expansion of macro
Prototype: The macro name and parameters define a pattern or prototype
S: size
MDT
MDTC <― 1
MNTC <― 1
No
Read next Yes
END psedo- GO TO PASS 2
source card op?
Read next
source card
(from pass 1) No
END Yes Supply expanded
Search MNT
pseudo-op? source file to
for match
assembler processing
with opcode