Intermediate Topic 27 of 50 Languages & Compilers
Three-Address Code
Simple IR with at most three operands per instruction.
How it works
Each instruction has at most three operands (x = y op z), with temporaries for subexpressions, making analysis and optimization simpler.
Where it is used
Textbook compiler IR.
Common pitfall
Many temporaries inflate register pressure.
Where it fits in the course
Three-Address Code is topic 27 of 50 in Languages & Compilers, rated Intermediate. It follows Intermediate Representations. The next topic is Static Single Assignment.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Languages & Compilers quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Languages & Compilers quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Three-Address Code?
Simple IR with at most three operands per instruction. It belongs to Languages & Compilers and is an intermediate-level topic.
Where do people use Three-Address Code?
Textbook compiler IR.
What is the most common mistake with Three-Address Code?
Many temporaries inflate register pressure.
What should I learn before this topic?
Start with Intermediate Representations, the topic just before it in Languages & Compilers.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Languages & Compilers quiz.
Is Three-Address Code hard to learn?
It is an Intermediate topic. Be comfortable with the Beginner topics in this area first, then read the common pitfall carefully, since it is where most mistakes happen.
How long does it take to learn Three-Address Code?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Three-Address Code?
Intermediate Representations, Static Single Assignment, Parser Generators are closely connected. The full list is in the related topics section of this page.
What should I study after Three-Address Code?
Continue with Static Single Assignment, the next topic in Languages & Compilers.
Related topics
- Intermediate Representations (Languages & Compilers)
- Static Single Assignment (Languages & Compilers)
- Parser Generators (Languages & Compilers)
- Control Flow Graphs (Languages & Compilers)
- Code Style and Readability (Software Engineering)
- Code Reviews (Software Engineering)
- Three-Way Handshake (Computer Networks)