This PPT covers the entire topic of Macro Assembler. This Includes the topic such as design of a macro assembler, 3 passes of macro assembler etc.
This is the PPT of System Programming.
4. pass 3:
– Target code Generation.
– Macro processor can be added asa
processor to an assembler.
– It is implemented in pass 1 of the
assembler.
Design of Macro AssembleR
5. Advantages:
– Many functions don’t have to be
implemented twice.
– Less overhead during processing.(by
removing intermediate code)
– More flexibility is available to the
programmer.
Design of Macro AssembleR
6. Disadvantages:
• Combined pass 1 of the assembler &
macro processor may be too large for a
program to fit into core of some
machine.
• Complexity of such program maybe
overwhelming.
Design of Macro AssembleR
8. Microsoft Macro Assembler
MASM is an assembler for the x86 family of microprocessors,
originally produced MS-DOS operating system. The MASM is the
example of high level assembler. It supports following main
features-
i) A wide variety of macro facilities
ii) Structure programming idioms
iii)High level constructions for looping, procedure calls , and
alteration
The later versions of MASM added the capability of producing
program for the windows operating system. The example of this
type is MASM – 32 which work on the program which already
written API based code in windows .
9. Comparison of Macro Processors
Design
Single pass
every macro must be defined before it is called
one-pass processor can alternate between macro definition and
macro expansion
nested macro definitions may be allowed but nested calls are
not
Two pass
Pass1: Recognize macro definitions
Pass2: Recognize macro calls
nested macro definitions are not allowed
10. Tables generated while macro
processing
The macro processing leads to generation of three
types of tables –
1. DEFTAB – the definition of the macro is stored in
this table.
2. NAMTAB – the name of the macro is stored in
this table.
3. ARGTAB – all the arguments of macro is stored
in this table.