100000f70: 100000f71: pushq %rbp 55 48 89 e5 89 7d fc c7 45 18 02 ee ee ee 8b 7d f8 movq movl Krsp, Krbp Kedi, -4(%rbp) int foolint num) { int val = 2; int result = val - num; 10000er81: 100000f74: 100000177: $2, -8(%rbp movl -8(%rbp), %edi -4 (Krbp), Nedi %edi, -12(Nrbp) -12 (%rbp), %eax 10000017e: movl Of af 7d fc imull movl 100000f85: 89 7d 14 return result; 100000f88: 8b 45 f4 movl 100000f8b: 5d %rbp popq retq 100000f8c: c3 int foo(int num) : pushg &rbp movg trap, rbp movl tedi, -4 (%rbp)e

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
2. Given the following code snippet and assembly instructions, align the code with the
corresponding assembly. The first line has already been done for you
23fooii:
10000er68:
55
pusha
Krbp
10000ef61:
48 89 e5
Krsp, Krbp
89 7d fc
mova
movl
10000ef64:
%edi, -4(%rbp)
%esi, -8(%rbp)
movl
$3, -4(%rbp), %esi
%esi, -16(%rbp)
-8(Krbp), %esi
-12(Xrbp), Nesi
Kesi, -20(%rbp)
-12(Xrbp), Xesi
-16(Nrbp), %esi
%esi, -24 (%rbp)
-24 (%rbp), %eax
10000ef67:
movl
c7 45 14 02 ee ee ee
imull
movl
movl
89 75 18
int foo(int num1, int num2){
int val1 = 2;
int val2 = 3 * num1;
int val3 = num2 + val1;
int result = val1 - val2; 1e000e17e:
10000ef6a:
$2, -12(Nrbp)
100000f71:
6b 75 fc 03
10000ef75:
18000ef78:
89 75 fe
8b 75 f8
03 75 14
addl
movl
movl
10000ef7b:
89 75 ec
8b 75 f4
2b 75 fe
10000er81:
10000ef84:
subl
return result;
89 75 e8
8b 45 e8
5d
movl
movl
10000er87:
10000ef8a:
10000ef8d:
}
Krbp
popa
1000eef8e:
c3
reta
int foo (int numl, int num2) :
pushg &rbp
movg trsp, rbp
movl tedi,
movl sesi, -8 (8rbp) e
-4 (rbp)e
www w
Transcribed Image Text:2. Given the following code snippet and assembly instructions, align the code with the corresponding assembly. The first line has already been done for you 23fooii: 10000er68: 55 pusha Krbp 10000ef61: 48 89 e5 Krsp, Krbp 89 7d fc mova movl 10000ef64: %edi, -4(%rbp) %esi, -8(%rbp) movl $3, -4(%rbp), %esi %esi, -16(%rbp) -8(Krbp), %esi -12(Xrbp), Nesi Kesi, -20(%rbp) -12(Xrbp), Xesi -16(Nrbp), %esi %esi, -24 (%rbp) -24 (%rbp), %eax 10000ef67: movl c7 45 14 02 ee ee ee imull movl movl 89 75 18 int foo(int num1, int num2){ int val1 = 2; int val2 = 3 * num1; int val3 = num2 + val1; int result = val1 - val2; 1e000e17e: 10000ef6a: $2, -12(Nrbp) 100000f71: 6b 75 fc 03 10000ef75: 18000ef78: 89 75 fe 8b 75 f8 03 75 14 addl movl movl 10000ef7b: 89 75 ec 8b 75 f4 2b 75 fe 10000er81: 10000ef84: subl return result; 89 75 e8 8b 45 e8 5d movl movl 10000er87: 10000ef8a: 10000ef8d: } Krbp popa 1000eef8e: c3 reta int foo (int numl, int num2) : pushg &rbp movg trsp, rbp movl tedi, movl sesi, -8 (8rbp) e -4 (rbp)e www w
1. Given the following code snippet and assembly instructions, align the code with the
corresponding assembly. The first line has already been done for you.
-_23fooi:
100000f70:
55
pushq
%rbp
%rsp, %rbp
%edi, -4(%rbp)
movl
100000f71:
48 89 e5
movq
int foolint num){
int val = 2;
89 7d fc
100000f74:
100000f77:
100000f7e:
int result = val num; 10000e181:
movl
c7 45 f8 02 ee ee 00
movl
imull
movl
movl
$2, -8(%rbp)
-8(%rbp), %edi
-4(%rbp), %edi
%edi, -12(%rbp)
-12 (%rbp), %eax
8b 7d f8
ef af 7d fc
100000f85:
100000f88:
89 7d f4
return result;
8b 45 f4
100000f8b:
5d
%rbp
popa
retq
100000f8c:
c3
int foo (int num) :
Rushg &rbp
movg rsp, trbp
movl šedi, -4 (8rbp)e
Transcribed Image Text:1. Given the following code snippet and assembly instructions, align the code with the corresponding assembly. The first line has already been done for you. -_23fooi: 100000f70: 55 pushq %rbp %rsp, %rbp %edi, -4(%rbp) movl 100000f71: 48 89 e5 movq int foolint num){ int val = 2; 89 7d fc 100000f74: 100000f77: 100000f7e: int result = val num; 10000e181: movl c7 45 f8 02 ee ee 00 movl imull movl movl $2, -8(%rbp) -8(%rbp), %edi -4(%rbp), %edi %edi, -12(%rbp) -12 (%rbp), %eax 8b 7d f8 ef af 7d fc 100000f85: 100000f88: 89 7d f4 return result; 8b 45 f4 100000f8b: 5d %rbp popa retq 100000f8c: c3 int foo (int num) : Rushg &rbp movg rsp, trbp movl šedi, -4 (8rbp)e
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY