Compile the pseudo-x86 program below into x86, placing all variables on the stack. movq $1, x movq $4, tmp_1 addq $5, tmp_1 movq tmp_1, tmp_2 addq x, tmp_2 movq tmp_2, %rdi callq print_int Part (a): for each variable in the program, assign the variable a home on the stack. • x: • tmp_1 : • tmp_2 : Part (b): what is the size (in bytes) of the stack frame for this program?

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question
x86 / compiler passes / stack allocation
Compile the pseudo-x86 program below into x86, placing all variables on the stack.
movq $1, x
movq $4, tmp_1
addq $5, tmp_1
movq tmp_1, tmp_2
addq x, tmp_2
movq tmp_2, %rdi
callq print_int
Part (a): for each variable in the program, assign the variable a home on the stack.
x :
tmp_1 :
tmp_2 :
Part (b): what is the size (in bytes) of the stack frame for this program?
Part (c): write down the complete x86
program
Transcribed Image Text:x86 / compiler passes / stack allocation Compile the pseudo-x86 program below into x86, placing all variables on the stack. movq $1, x movq $4, tmp_1 addq $5, tmp_1 movq tmp_1, tmp_2 addq x, tmp_2 movq tmp_2, %rdi callq print_int Part (a): for each variable in the program, assign the variable a home on the stack. x : tmp_1 : tmp_2 : Part (b): what is the size (in bytes) of the stack frame for this program? Part (c): write down the complete x86 program
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Stack
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning