SlideShare a Scribd company logo
CSE340 - Principles of
Programming Languages
Lecture 23:
Intermediate Code IV
Javier Gonzalez-Sanchez
BYENG M1-38
Office Hours: By appointment
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 8
Code
WHILE
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 9
Code
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 10
Code
IF
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 11
Code
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 12
Review
Programming Assignment 4
Level 3
Bonus Points: SWITCH
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 13
Homework
Translate this source code to intermediate code:
int a;
switch (a) {
case 1: { print("hi”); break;}
case 2: { print("world"); break;}
default: { print(”end"); break;}
}
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 14
Handwritten notes
Add the symbol table here…
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 15
Homework
Assignment #4
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 16
High-Level Languages
X,E,G,O,O
#e1,I,I,0,7
@
OPR 19, AX
STO x, AX
LIT 5, AX
OPR 21, AX
LOD #e1,AX
CAL 1, AX
OPR 0, AX
5
Virtual Machine
(interpreter)
// sorce code
int x;
int foo () {
read (x);
print (5);
}
main () {
foo ();
}
Lexer
Parser
Semantic Analyzer
Code Generation
01001010101000010
01010100101010010
10100100000011011
11010010110101111
00010010101010010
10101001010101011
Assembler
compilation execution
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 17
Language Paradigms
CSE340 - Principles of Programming Languages
Javier Gonzalez-Sanchez
javiergs@asu.edu
Summer 2015
Disclaimer. These slides can only be used as study material for the class CSE340 at ASU. They cannot be distributed or used for another purpose.

More Related Content

PDF
201506 CSE340 Lecture 22
PDF
201506 CSE340 Lecture 21
PDF
201505 CSE340 Lecture 05
PDF
201506 CSE340 Lecture 20
PDF
201505 CSE340 Lecture 06
PDF
201506 CSE340 Lecture 18
PDF
201506 CSE340 Lecture 19
PDF
201506 CSE340 Lecture 07
201506 CSE340 Lecture 22
201506 CSE340 Lecture 21
201505 CSE340 Lecture 05
201506 CSE340 Lecture 20
201505 CSE340 Lecture 06
201506 CSE340 Lecture 18
201506 CSE340 Lecture 19
201506 CSE340 Lecture 07

What's hot (10)

PDF
201506 CSE340 Lecture 13
PDF
201505 CSE340 Lecture 02
PDF
201506 CSE340 Lecture 14
PDF
201506 CSE340 Lecture 10
PDF
201506 CSE340 Lecture 15
PDF
201506 CSE340 Lecture 11
PDF
201506 CSE340 Lecture 09
PPTX
PPTX
C++ questions
201506 CSE340 Lecture 13
201505 CSE340 Lecture 02
201506 CSE340 Lecture 14
201506 CSE340 Lecture 10
201506 CSE340 Lecture 15
201506 CSE340 Lecture 11
201506 CSE340 Lecture 09
C++ questions
Ad

Viewers also liked (20)

PPT
Syndrome metabolique et maladies vasculaires
PPT
Thirst Upload 800x600 1215534320518707 8
PDF
Eurochap2010 final program
PPT
Demonstration Presentation
PPTX
Tabagisme et thrombose habbal
PDF
Paul Harris Fellow Clubs En
PPT
Barya Perception
PPT
Uip Romain
ODP
Diapositivas
PDF
Angeio 1 2010
PPS
Amigos de verdad
PDF
201001 Face-Based Emotion Recognition
PDF
Login Seminars Blackboard Directions 2009
PPT
Chapter 12
PDF
201004 - brain computer interaction
PPT
Sociale media en journalistiek
PDF
200910 - iPhone at OOPSLA
PDF
Phenomenal Oct, 29, 2009
PDF
Week10
Syndrome metabolique et maladies vasculaires
Thirst Upload 800x600 1215534320518707 8
Eurochap2010 final program
Demonstration Presentation
Tabagisme et thrombose habbal
Paul Harris Fellow Clubs En
Barya Perception
Uip Romain
Diapositivas
Angeio 1 2010
Amigos de verdad
201001 Face-Based Emotion Recognition
Login Seminars Blackboard Directions 2009
Chapter 12
201004 - brain computer interaction
Sociale media en journalistiek
200910 - iPhone at OOPSLA
Phenomenal Oct, 29, 2009
Week10
Ad

More from Javier Gonzalez-Sanchez (20)

PDF
201804 SER332 Lecture 01
PDF
201801 SER332 Lecture 03
PDF
201801 SER332 Lecture 04
PDF
201801 SER332 Lecture 02
PDF
201801 CSE240 Lecture 26
PDF
201801 CSE240 Lecture 25
PDF
201801 CSE240 Lecture 24
PDF
201801 CSE240 Lecture 23
PDF
201801 CSE240 Lecture 22
PDF
201801 CSE240 Lecture 21
PDF
201801 CSE240 Lecture 20
PDF
201801 CSE240 Lecture 19
PDF
201801 CSE240 Lecture 18
PDF
201801 CSE240 Lecture 17
PDF
201801 CSE240 Lecture 16
PDF
201801 CSE240 Lecture 15
PDF
201801 CSE240 Lecture 14
PDF
201801 CSE240 Lecture 13
PDF
201801 CSE240 Lecture 12
PDF
201801 CSE240 Lecture 11
201804 SER332 Lecture 01
201801 SER332 Lecture 03
201801 SER332 Lecture 04
201801 SER332 Lecture 02
201801 CSE240 Lecture 26
201801 CSE240 Lecture 25
201801 CSE240 Lecture 24
201801 CSE240 Lecture 23
201801 CSE240 Lecture 22
201801 CSE240 Lecture 21
201801 CSE240 Lecture 20
201801 CSE240 Lecture 19
201801 CSE240 Lecture 18
201801 CSE240 Lecture 17
201801 CSE240 Lecture 16
201801 CSE240 Lecture 15
201801 CSE240 Lecture 14
201801 CSE240 Lecture 13
201801 CSE240 Lecture 12
201801 CSE240 Lecture 11

Recently uploaded (20)

PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Nekopoi APK 2025 free lastest update
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
L1 - Introduction to python Backend.pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
top salesforce developer skills in 2025.pdf
PDF
AI in Product Development-omnex systems
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
ai tools demonstartion for schools and inter college
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Nekopoi APK 2025 free lastest update
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Internet Downloader Manager (IDM) Crack 6.42 Build 41
L1 - Introduction to python Backend.pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
top salesforce developer skills in 2025.pdf
AI in Product Development-omnex systems
How Creative Agencies Leverage Project Management Software.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Operating system designcfffgfgggggggvggggggggg
ai tools demonstartion for schools and inter college
Upgrade and Innovation Strategies for SAP ERP Customers
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Design an Analysis of Algorithms II-SECS-1021-03
wealthsignaloriginal-com-DS-text-... (1).pdf
Design an Analysis of Algorithms I-SECS-1021-03

201506 CSE340 Lecture 23

  • 1. CSE340 - Principles of Programming Languages Lecture 23: Intermediate Code IV Javier Gonzalez-Sanchez BYENG M1-38 Office Hours: By appointment
  • 2. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 8 Code WHILE
  • 3. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 9 Code
  • 4. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 10 Code IF
  • 5. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 11 Code
  • 6. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 12 Review Programming Assignment 4 Level 3 Bonus Points: SWITCH
  • 7. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 13 Homework Translate this source code to intermediate code: int a; switch (a) { case 1: { print("hi”); break;} case 2: { print("world"); break;} default: { print(”end"); break;} }
  • 8. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 14 Handwritten notes Add the symbol table here…
  • 9. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 15 Homework Assignment #4
  • 10. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 16 High-Level Languages X,E,G,O,O #e1,I,I,0,7 @ OPR 19, AX STO x, AX LIT 5, AX OPR 21, AX LOD #e1,AX CAL 1, AX OPR 0, AX 5 Virtual Machine (interpreter) // sorce code int x; int foo () { read (x); print (5); } main () { foo (); } Lexer Parser Semantic Analyzer Code Generation 01001010101000010 01010100101010010 10100100000011011 11010010110101111 00010010101010010 10101001010101011 Assembler compilation execution
  • 11. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 17 Language Paradigms
  • 12. CSE340 - Principles of Programming Languages Javier Gonzalez-Sanchez javiergs@asu.edu Summer 2015 Disclaimer. These slides can only be used as study material for the class CSE340 at ASU. They cannot be distributed or used for another purpose.