Command line arguments are passed to int main(int argc, char** argv) as arguments argc and argv. You should assume that argc is at ebp+8 and argv is at ebp+12. This program is invoked from the command line as shown: ./program 5 7 The procedure named what is called from main, and returns to main with the value:   Options: a) 11 b) 66

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter1: Getting Started With Excel
Section: Chapter Questions
Problem 3.8CP
icon
Related questions
Topic Video
Question
100%

Command line arguments are passed to int main(int argc, char** argv) as arguments argc and argv. You should assume that argc is at ebp+8 and argv is at ebp+12.

This program is invoked from the command line as shown:

./program 5 7

The procedure named what is called from main, and returns to main with the value:

 

Options:

a) 11

b) 66

20
21 <main>
22 <main+4>
Өx4(%esp),%eсx
$0xfffffff0,%esp
-0x4 (%eсx)
%ebp
%esp,%ebp
lea
and
23 <main+7>
pushl
24 <main+10> push
25 <main+11>
26 <main+13>
mov
push
push
%ebx
27 <main+14>
%есх
28 <main+15>
$0x10,%esp
%есх,%ebx
Өx4(%ebx),%eаx
$0x4,%eax
(%eax),%eaх
$0xc,%esp
sub
29 <main+18>
mov
30 <main+20>
31 <main+23>
mov
add
32 <main+26>
mov
33 <main+28>
sub
34 <main+31>
35 <main+32>
push
%eax
<atoi@plt>
$0x10,%esp
%eax,-0xc(%ebp)
Оx4(%ebx),%eax
$0x8,%eax
(%eax),%eax
$0xc,%esp
call
36 <main+37>
add
37 <main+40>
mov
38 <main+43>
mov
39 <main+46>
40 <main+49>
add
mov
41 <main+51>
sub
push
call
42 <main+54>
%eax
43 <main+55>
44 <main+60>
<atoi@plt>
$0x10,%esp
%eax,-0x10(%ebp)
-0x10 (%ebp),%eax
Өx1(%eаx),%edx
-0xс(%ebp), %eax
$0x2,%eax
$0x8,%esp
add
45 <main+63>
mov
46 <main+66>
mov
47 <main+69>
48 <main+72>
lea
mov
49 <main+75>
add
50 <main+78>
sub
51 <main+81>
push
push
call
%edx
52 <main+82>
53 <main+83>
%eax
<what>
54 <main+88>
$0x10,%esp
%eax,-0x14(%ebp)
$0x0,%eax
-0x8(%ebp),%esp
add
55 <main+91>
mov
56 <main+94>
mov
57 <main+99>
58 <main+102> рор
59 <main+103> роp
60 <main+104> роp
lea
%ecx
%ebx
%ebp
-0x4(%eсx),%esp
61 <main+105> lea
62 <main+108> ret
63 |
Transcribed Image Text:20 21 <main> 22 <main+4> Өx4(%esp),%eсx $0xfffffff0,%esp -0x4 (%eсx) %ebp %esp,%ebp lea and 23 <main+7> pushl 24 <main+10> push 25 <main+11> 26 <main+13> mov push push %ebx 27 <main+14> %есх 28 <main+15> $0x10,%esp %есх,%ebx Өx4(%ebx),%eаx $0x4,%eax (%eax),%eaх $0xc,%esp sub 29 <main+18> mov 30 <main+20> 31 <main+23> mov add 32 <main+26> mov 33 <main+28> sub 34 <main+31> 35 <main+32> push %eax <atoi@plt> $0x10,%esp %eax,-0xc(%ebp) Оx4(%ebx),%eax $0x8,%eax (%eax),%eax $0xc,%esp call 36 <main+37> add 37 <main+40> mov 38 <main+43> mov 39 <main+46> 40 <main+49> add mov 41 <main+51> sub push call 42 <main+54> %eax 43 <main+55> 44 <main+60> <atoi@plt> $0x10,%esp %eax,-0x10(%ebp) -0x10 (%ebp),%eax Өx1(%eаx),%edx -0xс(%ebp), %eax $0x2,%eax $0x8,%esp add 45 <main+63> mov 46 <main+66> mov 47 <main+69> 48 <main+72> lea mov 49 <main+75> add 50 <main+78> sub 51 <main+81> push push call %edx 52 <main+82> 53 <main+83> %eax <what> 54 <main+88> $0x10,%esp %eax,-0x14(%ebp) $0x0,%eax -0x8(%ebp),%esp add 55 <main+91> mov 56 <main+94> mov 57 <main+99> 58 <main+102> рор 59 <main+103> роp 60 <main+104> роp lea %ecx %ebx %ebp -0x4(%eсx),%esp 61 <main+105> lea 62 <main+108> ret 63 |
1 <what>
%ebp
%esp,%ebp
$0x10,%esp
Өx8(%ebp),%eax
$0x4,%eax
%eax,-0x4(%ebp)
Оx8(%ebp),%eax
Оxc(%ebp),%eax
%eax,-0x8(%ebp)
Оx8(%ebp),%eax
Өxc (%ebp),%eax
%eax,-0xc(%ebp)
-0x4(%ebp),%edx
-өx8(%ebp),%eax
%eax,%edx
-0хс (%ebp), %eax
%edx,%eax
push
2 <what+1>
mov
3 <what+3>
sub
4 <what+6>
mov
5 <what+9>
add
6 <what+12>
mov
7 <what+15>
mov
8 <what+18> imul
9 <what+22>
mov
10 <what+25>
mov
11 <what+28>
sub
12 <what+31>
mov
13 <what+34>
mov
14 <what+37>
mov
15 <what+40>
add
16 <what+42>
mov
17 <what+45>
add
18 <what+47> leave
19 <what+48>
ret
20
Transcribed Image Text:1 <what> %ebp %esp,%ebp $0x10,%esp Өx8(%ebp),%eax $0x4,%eax %eax,-0x4(%ebp) Оx8(%ebp),%eax Оxc(%ebp),%eax %eax,-0x8(%ebp) Оx8(%ebp),%eax Өxc (%ebp),%eax %eax,-0xc(%ebp) -0x4(%ebp),%edx -өx8(%ebp),%eax %eax,%edx -0хс (%ebp), %eax %edx,%eax push 2 <what+1> mov 3 <what+3> sub 4 <what+6> mov 5 <what+9> add 6 <what+12> mov 7 <what+15> mov 8 <what+18> imul 9 <what+22> mov 10 <what+25> mov 11 <what+28> sub 12 <what+31> mov 13 <what+34> mov 14 <what+37> mov 15 <what+40> add 16 <what+42> mov 17 <what+45> add 18 <what+47> leave 19 <what+48> ret 20
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Instruction Format
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
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Enhanced Discovering Computers 2017 (Shelly Cashm…
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole