SlideShare a Scribd company logo
1 of 13
PRESENTATION ON MACROS & MACRO PROCESSOR
Submitted To: Submitted By:
Er. Ritika Yaduvanshi Kuldeep Pathak
ID.No.:- E-9965/17
B.Tech.:- 3rd year(C.S.E.)
Introduction
• Macro instructions are single line abbreviations for groups of
instructions.
• It allows the programmer to write shorthand version of a
program.
• The macro processor replaces each macro invocation with the
corresponding sequence of statements.
Macro Processor
• Recognize macro definitions
• Save the macro definition
• Recognize macro calls
• Expand macro calls
Source
Code
(with macro)
Macro
Processor
Expanded
Code
Compiler or
Assembler
obj
Macro Instructions
• Example 1 :-
.
.
.
A 1,DATA Add contents of DATA to register 1
A 2,DATA Add contents of DATA to register 2
A 3,DATA Add contents of DATA to register 3
.
.
.
A 1,DATA Add contents of DATA to register 1
A 2,DATA Add contents of DATA to register 2
A 3,DATA Add contents of DATA to register 3
.
.
.
DATA DC F’5’
.
.
.
Macro Instructions
• We attach a name to a sequence by means of a macro
instruction definition.
• Which is Formed in the following manner :
MACRO Start of Definition
[ ] Macro Name
______
______ Sequence to be abbreviated
______
MEND End of Definition
Example
.
Source Expended Source
MACRO
INCR
A 1,DATA
A 2,DATA
A 3,DATA
MEND
.
. .
. .
INCR
. A 1,DATA
. A 2,DATA
. A 3,DATA
.
INCR .
. A 1,DATA
. A 2,DATA
. A 3,DATA
DATA DC F’5’
.
.
.
Macro Instruction Arguments
• Example 2:
.
.
.
A 1,DATA 1
A 2,DATA 1
A 3,DATA 1
.
.
A 1,DATA 2
A 2,DATA 2
A 3,DATA 2
.
.
.
DATA 1 DC F’5’
DATA 2 DC F’10’
.
.
.
Macro Instruction Arguments
• The instruction sequences are very similar but not identical.
• It can be considered to perform the same operation with a
variable parameter or argument.
• It is specified on the macro name line and distinguished by
the ampersand (&).
Macro Instruction Arguments
Example :-
Source Expended Source
MACRO
INCR &ARG
A 1,&ARG
A 2,&ARG
A 3,&ARG
MEND
.
. .
. .
INCR DATA1
. A 1,DATA 1
. A 2,DATA 1
. A 3,DATA 1
.
INCR DATA2 .
. A 1,DATA 2
. A 2,DATA 2
. A 3,DATA 2
DATA1 DC F’5’
DATA2 DC F’10’
.
.
.
Macro Calls Within Macros
• Macro calls are available to use in other Macros.
• It is called nested macros.
• Macro calls within Macros can involve several levels.
Macro Calls Within Macros
• Example 3 :-
MACRO
ADD1 &ARG
L 1,&ARG
A 1,=F ’1’
ST 1,&ARG
MEND
MACRO
ADDS &ARG1,&ARG2,&ARG3
ADD1 &ARG1
ADD1 &ARG2
ADD1 &ARG3
MEND
Expansion of the code
Presentation on macros and macro processor

More Related Content

Similar to Presentation on macros and macro processor

System software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSystem software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSARASWATHI S
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit IIManoj Patil
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit IIManoj Patil
 
Micro Processor And Micro controller
Micro Processor And Micro controller Micro Processor And Micro controller
Micro Processor And Micro controller Raja pirian
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database DesignPrabu U
 
33443223 system-software-unit-iv
33443223 system-software-unit-iv33443223 system-software-unit-iv
33443223 system-software-unit-ivShaniya Fathimuthu
 
Task Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdfTask Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdfacsmadurai
 
Smu mca spring 2014 solved assignments
Smu mca spring 2014 solved assignmentsSmu mca spring 2014 solved assignments
Smu mca spring 2014 solved assignmentssmumbahelp
 

Similar to Presentation on macros and macro processor (20)

handout6.pdf
handout6.pdfhandout6.pdf
handout6.pdf
 
Macro
MacroMacro
Macro
 
MACRO PROCESSOR
MACRO PROCESSORMACRO PROCESSOR
MACRO PROCESSOR
 
Ss4
Ss4Ss4
Ss4
 
System software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSystem software - macro expansion,nested macro calls
System software - macro expansion,nested macro calls
 
Module 5.pdf
Module 5.pdfModule 5.pdf
Module 5.pdf
 
Unit 2
Unit 2Unit 2
Unit 2
 
Unit 4 sp macro
Unit 4 sp macroUnit 4 sp macro
Unit 4 sp macro
 
Handout#10
Handout#10Handout#10
Handout#10
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit II
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit II
 
Handout#04
Handout#04Handout#04
Handout#04
 
Micro Processor And Micro controller
Micro Processor And Micro controller Micro Processor And Micro controller
Micro Processor And Micro controller
 
Macro assembler
 Macro assembler Macro assembler
Macro assembler
 
Handout#05
Handout#05Handout#05
Handout#05
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
33443223 system-software-unit-iv
33443223 system-software-unit-iv33443223 system-software-unit-iv
33443223 system-software-unit-iv
 
Macro-processor
Macro-processorMacro-processor
Macro-processor
 
Task Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdfTask Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdf
 
Smu mca spring 2014 solved assignments
Smu mca spring 2014 solved assignmentsSmu mca spring 2014 solved assignments
Smu mca spring 2014 solved assignments
 

Recently uploaded

HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 

Presentation on macros and macro processor

  • 1. PRESENTATION ON MACROS & MACRO PROCESSOR Submitted To: Submitted By: Er. Ritika Yaduvanshi Kuldeep Pathak ID.No.:- E-9965/17 B.Tech.:- 3rd year(C.S.E.)
  • 2. Introduction • Macro instructions are single line abbreviations for groups of instructions. • It allows the programmer to write shorthand version of a program. • The macro processor replaces each macro invocation with the corresponding sequence of statements.
  • 3. Macro Processor • Recognize macro definitions • Save the macro definition • Recognize macro calls • Expand macro calls Source Code (with macro) Macro Processor Expanded Code Compiler or Assembler obj
  • 4. Macro Instructions • Example 1 :- . . . A 1,DATA Add contents of DATA to register 1 A 2,DATA Add contents of DATA to register 2 A 3,DATA Add contents of DATA to register 3 . . . A 1,DATA Add contents of DATA to register 1 A 2,DATA Add contents of DATA to register 2 A 3,DATA Add contents of DATA to register 3 . . . DATA DC F’5’ . . .
  • 5. Macro Instructions • We attach a name to a sequence by means of a macro instruction definition. • Which is Formed in the following manner : MACRO Start of Definition [ ] Macro Name ______ ______ Sequence to be abbreviated ______ MEND End of Definition
  • 6. Example . Source Expended Source MACRO INCR A 1,DATA A 2,DATA A 3,DATA MEND . . . . . INCR . A 1,DATA . A 2,DATA . A 3,DATA . INCR . . A 1,DATA . A 2,DATA . A 3,DATA DATA DC F’5’ . . .
  • 7. Macro Instruction Arguments • Example 2: . . . A 1,DATA 1 A 2,DATA 1 A 3,DATA 1 . . A 1,DATA 2 A 2,DATA 2 A 3,DATA 2 . . . DATA 1 DC F’5’ DATA 2 DC F’10’ . . .
  • 8. Macro Instruction Arguments • The instruction sequences are very similar but not identical. • It can be considered to perform the same operation with a variable parameter or argument. • It is specified on the macro name line and distinguished by the ampersand (&).
  • 9. Macro Instruction Arguments Example :- Source Expended Source MACRO INCR &ARG A 1,&ARG A 2,&ARG A 3,&ARG MEND . . . . . INCR DATA1 . A 1,DATA 1 . A 2,DATA 1 . A 3,DATA 1 . INCR DATA2 . . A 1,DATA 2 . A 2,DATA 2 . A 3,DATA 2 DATA1 DC F’5’ DATA2 DC F’10’ . . .
  • 10. Macro Calls Within Macros • Macro calls are available to use in other Macros. • It is called nested macros. • Macro calls within Macros can involve several levels.
  • 11. Macro Calls Within Macros • Example 3 :- MACRO ADD1 &ARG L 1,&ARG A 1,=F ’1’ ST 1,&ARG MEND MACRO ADDS &ARG1,&ARG2,&ARG3 ADD1 &ARG1 ADD1 &ARG2 ADD1 &ARG3 MEND