SlideShare a Scribd company logo
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

handout6.pdf
handout6.pdfhandout6.pdf
handout6.pdf
ssuser700533
 
Macro
MacroMacro
MACRO PROCESSOR
MACRO PROCESSORMACRO PROCESSOR
MACRO PROCESSOR
Bhavik Vashi
 
Ss4
Ss4Ss4
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
SARASWATHI S
 
Module 5.pdf
Module 5.pdfModule 5.pdf
Module 5.pdf
SE14Darshan
 
Unit 2
Unit 2Unit 2
Unit 2
pm_ghate
 
Unit 4 sp macro
Unit 4 sp macroUnit 4 sp macro
Unit 4 sp macro
Deepmala Sharma
 
Handout#10
Handout#10Handout#10
Handout#10
Sunita Milind Dol
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit II
Manoj Patil
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit II
Manoj Patil
 
Handout#04
Handout#04Handout#04
Handout#04
Sunita Milind Dol
 
Micro Processor And Micro controller
Micro Processor And Micro controller Micro Processor And Micro controller
Micro Processor And Micro controller
Raja pirian
 
Macro assembler
 Macro assembler Macro assembler
Macro assembler
Meghaj Mallick
 
Handout#05
Handout#05Handout#05
Handout#05
Sunita Milind Dol
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
Prabu U
 
33443223 system-software-unit-iv
33443223 system-software-unit-iv33443223 system-software-unit-iv
33443223 system-software-unit-iv
Shaniya Fathimuthu
 
Macro-processor
Macro-processorMacro-processor
Macro-processor
Temesgen Molla
 
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
acsmadurai
 
Smu mca spring 2014 solved assignments
Smu mca spring 2014 solved assignmentsSmu mca spring 2014 solved assignments
Smu mca spring 2014 solved assignments
smumbahelp
 

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

Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
PuktoonEngr
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
ssuser36d3051
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 

Recently uploaded (20)

Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 

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