SlideShare a Scribd company logo
1 of 23
DEPARTMENT OF COMPUTER SCIENCE & APPLICALION
ATAL BIHARI VAJPAYEE VISHWAVIDYALAYA
Assignment
Three address code
Submitted By
Ujjwal matoliya
MCA 2nd sem
INDEX
Compiler Phase
Intermediate Code Generation
Three address code
Three address code is used in compiler
applications
s
Compiler Phases
INPUT
OUTPUT
Intermediate Code Generation
Intermediate code can translate the source
program into the machine program.
Intermediate code is generated because the
compiler can’t generate machine code
directly in one pass. Therefore, first, it
converts the source program into
intermediate code, which performs efficient
generation of machine code further. The
intermediate code can be represented in the
form of postfix notation, syntax tree, directed
acyclic graph, three address codes,
Quadruples, and triples.
Application
Three Address Code
Postfix Notation
Syntax Trees
Quadruples representation
Triples representation
Three address code
Three-address code is an intermediate
code. It is used by the optimizing
compilers.
In three-address code, the given
expression is broken down into several
separate instructions. These instructions
can easily translate into assembly
language.
Each Three address code instruction
has at most three operands. It is a
combination of assignment and a binary
operator.
Example
Example
a := (-c * b) + (-c * d)
Example
a := (-c * b) + (-c * d)
t1 := -c
Example
a := (-c * b) + (-c * d)
t1 := -c
t2 := b*t1
Example
a := (-c * b) + (-c * d)
t1 := -c
t2 := b*t1
t3 := -c
Example
a := (-c * b) + (-c * d)
t1 := -c
t2 := b*t1
t3 := -c
t4 := d * t3
Example
a := (-c * b) + (-c * d)
t1 := -c
t2 := b*t1
t3 := -c
t4 := d * t3
t5 := t2 + t4
Example
a := (-c * b) + (-c * d)
t1 := -c
t2 := b*t1
t3 := -c
t4 := d * t3
t5 := t2 + t4
a := t5
Three address code is used in
compiler applications:
Three address code is used in
compiler applications:
Optimization: Three address code
is often used as an intermediate
representation of code during
optimization phases of the
compilation process. The three
address code allows the compiler
to analyze the code and perform
optimizations that can improve the
performance of the generated
code.
Three address code is used in
compiler applications:
Optimization: Three address code is often used as an intermediate
representation of code during optimization phases of the compilation
process. The three address code allows the compiler to analyze the
code and perform optimizations that can improve the performance of
the generated code.
Code generation: Three address code can
also be used as an intermediate representation
of code during the code generation phase of
the compilation process. The three address
code allows the compiler to generate code that
is specific to the target platform, while also
ensuring that the generated code is correct and
efficient.
Three address code is used in
compiler applications:
Optimization: Three address code is often used as an intermediate
representation of code during optimization phases of the compilation
process. The three address code allows the compiler to analyze the
code and perform optimizations that can improve the performance of
the generated code.
Code generation: Three address code can also be used as an
intermediate representation of code during the code generation phase of
the compilation process. The three address code allows the compiler to
generate code that is specific to the target platform, while also ensuring
that the generated code is correct and efficient.
Debugging: Three address code can be
helpful in debugging the code generated by
the compiler. Since three address code is a
low-level language, it is often easier to read
and understand than the final generated code.
Three address code is used in
compiler applications:
Optimization: Three address code is often used as an
intermediate representation of code during optimization phases
of the compilation process. The three address code allows the
compiler to analyze the code and perform optimizations that can
improve the performance of the generated code.
Code generation: Three address code can also be used as an
intermediate representation of code during the code generation
phase of the compilation process. The three address code allows
the compiler to generate code that is specific to the target
platform, while also ensuring that the generated code is correct
and efficient.
Debugging: Three address code can be helpful in debugging
the code generated by the compiler. Since three address code is a
low-level language, it is often easier to read and understand than
the final generated code.
Intermediate code can translate the source
program into the machine program.
Intermediate code is generated because the
compiler can’t generate machine code
directly in one pass. Therefore, first, it
converts the source program into
intermediate code, which performs efficient
generation of machine code further. The
intermediate code can be represented in the
form of postfix notation, syntax tree, directed
acyclic graph, three address codes,
Quadruples, and triples.

More Related Content

Similar to 3 address code ujjwal matoliya.pptx

Chapter 11 - Intermediate Code Generation.pdf
Chapter 11 - Intermediate Code Generation.pdfChapter 11 - Intermediate Code Generation.pdf
Chapter 11 - Intermediate Code Generation.pdfRAnwarpasha
 
Concept of compiler in details
Concept of compiler in detailsConcept of compiler in details
Concept of compiler in detailskazi_aihtesham
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfDrIsikoIsaac
 
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docxvenkatapranaykumarGa
 
Code generation errors and recovery
Code generation errors and recoveryCode generation errors and recovery
Code generation errors and recoveryMomina Idrees
 
1 - Introduction to Compilers.ppt
1 - Introduction to Compilers.ppt1 - Introduction to Compilers.ppt
1 - Introduction to Compilers.pptRakesh Kumar
 
what is compiler and five phases of compiler
what is compiler and five phases of compilerwhat is compiler and five phases of compiler
what is compiler and five phases of compileradilmehmood93
 
1588147798Begining_ABUAD1.pdf
1588147798Begining_ABUAD1.pdf1588147798Begining_ABUAD1.pdf
1588147798Begining_ABUAD1.pdfSemsemSameer1
 
Pros and cons of c as a compiler language
  Pros and cons of c as a compiler language  Pros and cons of c as a compiler language
Pros and cons of c as a compiler languageAshok Raj
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introductionRana Ehtisham Ul Haq
 
Compiler gate question key
Compiler gate question keyCompiler gate question key
Compiler gate question keyArthyR3
 
Dineshmaterial1 091225091539-phpapp02
Dineshmaterial1 091225091539-phpapp02Dineshmaterial1 091225091539-phpapp02
Dineshmaterial1 091225091539-phpapp02Tirumala Rao
 

Similar to 3 address code ujjwal matoliya.pptx (20)

Chapter 11 - Intermediate Code Generation.pdf
Chapter 11 - Intermediate Code Generation.pdfChapter 11 - Intermediate Code Generation.pdf
Chapter 11 - Intermediate Code Generation.pdf
 
Concept of compiler in details
Concept of compiler in detailsConcept of compiler in details
Concept of compiler in details
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdf
 
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
 
Code generation errors and recovery
Code generation errors and recoveryCode generation errors and recovery
Code generation errors and recovery
 
Compiler Design Material
Compiler Design MaterialCompiler Design Material
Compiler Design Material
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
phase of compiler
phase of compilerphase of compiler
phase of compiler
 
1 - Introduction to Compilers.ppt
1 - Introduction to Compilers.ppt1 - Introduction to Compilers.ppt
1 - Introduction to Compilers.ppt
 
The Phases of a Compiler
The Phases of a CompilerThe Phases of a Compiler
The Phases of a Compiler
 
what is compiler and five phases of compiler
what is compiler and five phases of compilerwhat is compiler and five phases of compiler
what is compiler and five phases of compiler
 
1588147798Begining_ABUAD1.pdf
1588147798Begining_ABUAD1.pdf1588147798Begining_ABUAD1.pdf
1588147798Begining_ABUAD1.pdf
 
Pros and cons of c as a compiler language
  Pros and cons of c as a compiler language  Pros and cons of c as a compiler language
Pros and cons of c as a compiler language
 
Cpcs302 1
Cpcs302  1Cpcs302  1
Cpcs302 1
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introduction
 
Compiler gate question key
Compiler gate question keyCompiler gate question key
Compiler gate question key
 
01. introduction
01. introduction01. introduction
01. introduction
 
Dineshmaterial1 091225091539-phpapp02
Dineshmaterial1 091225091539-phpapp02Dineshmaterial1 091225091539-phpapp02
Dineshmaterial1 091225091539-phpapp02
 
Trans coder
Trans coderTrans coder
Trans coder
 
Unit-2.pptx
Unit-2.pptxUnit-2.pptx
Unit-2.pptx
 

More from ujjwalmatoliya

kisan bill ujjwal matoliya.pptx
kisan bill ujjwal matoliya.pptxkisan bill ujjwal matoliya.pptx
kisan bill ujjwal matoliya.pptxujjwalmatoliya
 
Data Frames and Scatterplots in R language ujjwal matoliya.pptx
Data Frames and Scatterplots in R language ujjwal matoliya.pptxData Frames and Scatterplots in R language ujjwal matoliya.pptx
Data Frames and Scatterplots in R language ujjwal matoliya.pptxujjwalmatoliya
 
Floyd’s and Warshal’s Algorithm ujjwal matoliya.pptx
Floyd’s and Warshal’s Algorithm ujjwal matoliya.pptxFloyd’s and Warshal’s Algorithm ujjwal matoliya.pptx
Floyd’s and Warshal’s Algorithm ujjwal matoliya.pptxujjwalmatoliya
 
congestion ujjwal matoliya.pptx
congestion ujjwal matoliya.pptxcongestion ujjwal matoliya.pptx
congestion ujjwal matoliya.pptxujjwalmatoliya
 
Global Attributes Window Event Attributes Form Events Ujjwal matoliya.pptx
Global Attributes Window Event Attributes Form Events Ujjwal matoliya.pptxGlobal Attributes Window Event Attributes Form Events Ujjwal matoliya.pptx
Global Attributes Window Event Attributes Form Events Ujjwal matoliya.pptxujjwalmatoliya
 
Instruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptxInstruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptxujjwalmatoliya
 
javascript function ujjwal matoliya.pptx
javascript function ujjwal matoliya.pptxjavascript function ujjwal matoliya.pptx
javascript function ujjwal matoliya.pptxujjwalmatoliya
 
string functions in SQL ujjwal matoliya.pptx
string functions in SQL ujjwal matoliya.pptxstring functions in SQL ujjwal matoliya.pptx
string functions in SQL ujjwal matoliya.pptxujjwalmatoliya
 
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
 jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptxujjwalmatoliya
 
compiler design ujjwal matoliya 2nd sem MCA.pptx
compiler design ujjwal matoliya 2nd sem MCA.pptxcompiler design ujjwal matoliya 2nd sem MCA.pptx
compiler design ujjwal matoliya 2nd sem MCA.pptxujjwalmatoliya
 
2-3 tree ujjwal matoliya .pptx
2-3 tree ujjwal matoliya .pptx2-3 tree ujjwal matoliya .pptx
2-3 tree ujjwal matoliya .pptxujjwalmatoliya
 
Graph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptxGraph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptxujjwalmatoliya
 
Quick Sort in data structure.pptx
Quick Sort in data structure.pptxQuick Sort in data structure.pptx
Quick Sort in data structure.pptxujjwalmatoliya
 
Hadoop With R language.pptx
Hadoop With R language.pptxHadoop With R language.pptx
Hadoop With R language.pptxujjwalmatoliya
 
cyclomatic complecity.pptx
cyclomatic complecity.pptxcyclomatic complecity.pptx
cyclomatic complecity.pptxujjwalmatoliya
 
Congestion control algorithms.pptx
Congestion control algorithms.pptxCongestion control algorithms.pptx
Congestion control algorithms.pptxujjwalmatoliya
 
Game playing With AI.pptx
Game playing With AI.pptxGame playing With AI.pptx
Game playing With AI.pptxujjwalmatoliya
 

More from ujjwalmatoliya (20)

kisan bill ujjwal matoliya.pptx
kisan bill ujjwal matoliya.pptxkisan bill ujjwal matoliya.pptx
kisan bill ujjwal matoliya.pptx
 
Data Frames and Scatterplots in R language ujjwal matoliya.pptx
Data Frames and Scatterplots in R language ujjwal matoliya.pptxData Frames and Scatterplots in R language ujjwal matoliya.pptx
Data Frames and Scatterplots in R language ujjwal matoliya.pptx
 
Floyd’s and Warshal’s Algorithm ujjwal matoliya.pptx
Floyd’s and Warshal’s Algorithm ujjwal matoliya.pptxFloyd’s and Warshal’s Algorithm ujjwal matoliya.pptx
Floyd’s and Warshal’s Algorithm ujjwal matoliya.pptx
 
congestion ujjwal matoliya.pptx
congestion ujjwal matoliya.pptxcongestion ujjwal matoliya.pptx
congestion ujjwal matoliya.pptx
 
Global Attributes Window Event Attributes Form Events Ujjwal matoliya.pptx
Global Attributes Window Event Attributes Form Events Ujjwal matoliya.pptxGlobal Attributes Window Event Attributes Form Events Ujjwal matoliya.pptx
Global Attributes Window Event Attributes Form Events Ujjwal matoliya.pptx
 
Instruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptxInstruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptx
 
javascript function ujjwal matoliya.pptx
javascript function ujjwal matoliya.pptxjavascript function ujjwal matoliya.pptx
javascript function ujjwal matoliya.pptx
 
string functions in SQL ujjwal matoliya.pptx
string functions in SQL ujjwal matoliya.pptxstring functions in SQL ujjwal matoliya.pptx
string functions in SQL ujjwal matoliya.pptx
 
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
 jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
 
compiler design ujjwal matoliya 2nd sem MCA.pptx
compiler design ujjwal matoliya 2nd sem MCA.pptxcompiler design ujjwal matoliya 2nd sem MCA.pptx
compiler design ujjwal matoliya 2nd sem MCA.pptx
 
2-3 tree ujjwal matoliya .pptx
2-3 tree ujjwal matoliya .pptx2-3 tree ujjwal matoliya .pptx
2-3 tree ujjwal matoliya .pptx
 
Graph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptxGraph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptx
 
Quick Sort in data structure.pptx
Quick Sort in data structure.pptxQuick Sort in data structure.pptx
Quick Sort in data structure.pptx
 
Hadoop With R language.pptx
Hadoop With R language.pptxHadoop With R language.pptx
Hadoop With R language.pptx
 
LOGIC FAMILY.pptx
LOGIC FAMILY.pptxLOGIC FAMILY.pptx
LOGIC FAMILY.pptx
 
Transaction.pptx
Transaction.pptxTransaction.pptx
Transaction.pptx
 
cyclomatic complecity.pptx
cyclomatic complecity.pptxcyclomatic complecity.pptx
cyclomatic complecity.pptx
 
Congestion control algorithms.pptx
Congestion control algorithms.pptxCongestion control algorithms.pptx
Congestion control algorithms.pptx
 
computer graphic.pptx
computer graphic.pptxcomputer graphic.pptx
computer graphic.pptx
 
Game playing With AI.pptx
Game playing With AI.pptxGame playing With AI.pptx
Game playing With AI.pptx
 

Recently uploaded

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 

Recently uploaded (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 

3 address code ujjwal matoliya.pptx

  • 1. DEPARTMENT OF COMPUTER SCIENCE & APPLICALION ATAL BIHARI VAJPAYEE VISHWAVIDYALAYA Assignment Three address code Submitted By Ujjwal matoliya MCA 2nd sem
  • 2. INDEX Compiler Phase Intermediate Code Generation Three address code Three address code is used in compiler applications s
  • 4.
  • 6.
  • 7. Intermediate Code Generation Intermediate code can translate the source program into the machine program. Intermediate code is generated because the compiler can’t generate machine code directly in one pass. Therefore, first, it converts the source program into intermediate code, which performs efficient generation of machine code further. The intermediate code can be represented in the form of postfix notation, syntax tree, directed acyclic graph, three address codes, Quadruples, and triples.
  • 8. Application Three Address Code Postfix Notation Syntax Trees Quadruples representation Triples representation
  • 9. Three address code Three-address code is an intermediate code. It is used by the optimizing compilers. In three-address code, the given expression is broken down into several separate instructions. These instructions can easily translate into assembly language. Each Three address code instruction has at most three operands. It is a combination of assignment and a binary operator.
  • 11. Example a := (-c * b) + (-c * d)
  • 12. Example a := (-c * b) + (-c * d) t1 := -c
  • 13. Example a := (-c * b) + (-c * d) t1 := -c t2 := b*t1
  • 14. Example a := (-c * b) + (-c * d) t1 := -c t2 := b*t1 t3 := -c
  • 15. Example a := (-c * b) + (-c * d) t1 := -c t2 := b*t1 t3 := -c t4 := d * t3
  • 16. Example a := (-c * b) + (-c * d) t1 := -c t2 := b*t1 t3 := -c t4 := d * t3 t5 := t2 + t4
  • 17. Example a := (-c * b) + (-c * d) t1 := -c t2 := b*t1 t3 := -c t4 := d * t3 t5 := t2 + t4 a := t5
  • 18. Three address code is used in compiler applications:
  • 19. Three address code is used in compiler applications: Optimization: Three address code is often used as an intermediate representation of code during optimization phases of the compilation process. The three address code allows the compiler to analyze the code and perform optimizations that can improve the performance of the generated code.
  • 20. Three address code is used in compiler applications: Optimization: Three address code is often used as an intermediate representation of code during optimization phases of the compilation process. The three address code allows the compiler to analyze the code and perform optimizations that can improve the performance of the generated code. Code generation: Three address code can also be used as an intermediate representation of code during the code generation phase of the compilation process. The three address code allows the compiler to generate code that is specific to the target platform, while also ensuring that the generated code is correct and efficient.
  • 21. Three address code is used in compiler applications: Optimization: Three address code is often used as an intermediate representation of code during optimization phases of the compilation process. The three address code allows the compiler to analyze the code and perform optimizations that can improve the performance of the generated code. Code generation: Three address code can also be used as an intermediate representation of code during the code generation phase of the compilation process. The three address code allows the compiler to generate code that is specific to the target platform, while also ensuring that the generated code is correct and efficient. Debugging: Three address code can be helpful in debugging the code generated by the compiler. Since three address code is a low-level language, it is often easier to read and understand than the final generated code.
  • 22. Three address code is used in compiler applications: Optimization: Three address code is often used as an intermediate representation of code during optimization phases of the compilation process. The three address code allows the compiler to analyze the code and perform optimizations that can improve the performance of the generated code. Code generation: Three address code can also be used as an intermediate representation of code during the code generation phase of the compilation process. The three address code allows the compiler to generate code that is specific to the target platform, while also ensuring that the generated code is correct and efficient. Debugging: Three address code can be helpful in debugging the code generated by the compiler. Since three address code is a low-level language, it is often easier to read and understand than the final generated code.
  • 23. Intermediate code can translate the source program into the machine program. Intermediate code is generated because the compiler can’t generate machine code directly in one pass. Therefore, first, it converts the source program into intermediate code, which performs efficient generation of machine code further. The intermediate code can be represented in the form of postfix notation, syntax tree, directed acyclic graph, three address codes, Quadruples, and triples.