
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question

Transcribed Image Text:A Tul
1eave
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.
Ox401050
<what>:
push
šebp
Ox401051
<what+1>:
mov
šesp, šebp
Soxc, sesp
Ox8 (Sebp),šeax
0x401053
<what+3>:
sub
Ox401056
<what+6>:
mov
Ox401059
<what+9>:
add
S0x4, šeax
Sear
Seax, Oxfffffffc (sebp)
Ox40105c
<what+12>:
mov
Ox40105I
<what+15>:
Ox8 (Sebp), $eax
mov
Oxc (sebp), seax
Seax, OxffffffE8 (tebp)
Ox401062
<what+18>:
imul
ょううく、.
Ox401066
<what+22>:
mov
Oxc (tebp), tedx
Ox8 (tebp), teax
Ox401069
<what+25>:
mov
Ox40106c
<what+28>:
mov
Ox40106f
<what+31>:
sub
šedx, teax
Ox401071
<what+33>:
šeax, Oxfffffff4 (sebp)
mov
Ox401074
Oxfffffff8 (sebp), teax
Oxfffffffc (tebp), teax
Oxfffffff4 (Sebp), teax
<what+36>:
mov
Ox401077
<what+39>:
add
Ox40107a
<what+42>:
add
Ox40107d
<what+45>:
leave
Ox40107e
<what+46>:
ret
tebp
tesp, tebp
Ox401089
<main>:
push
Ox40108a
<main+1>:
;くT+UTRU>
sub
לווב
mov
Ox40108c
<main+3>:
S0x18, šesp
S0xfffffff0, tesp
$0x0, šeax
Ox40108f
<main+6>:
and
Ox401092
<main+9>:
mov
Ox401097
Ox40109a
<main+14>:
seax, Oxfffffff0 (sebp)
OxfffffEEO (tebp), $eax
mov
<main+17>:
mov
Ox40109d
<main+20>:
call
Ox401420 < alloca>
Ox4014b0 < main>
Oxc (šebp), teax
$0x4, šeax
Ox4010a2
<main+25>:
call
Ox4010a7
<main+30>:
mov
Ox4010aa
<main+33>:
add
(šeax), šeax
šeax, (sesp)
Ox4010ad
<main+36>:
mov
Ox4010af
<main+38>:
mov
Ox4010b2
<main+41>:
call
Ox4014d0 <atoi>
šeax, Oxfffffffc (sebp)
Oxc (sebp), šeax
$0x8, seax
(šeax), teax
seax, (tesp)
Ox4010b7
<main+46>:
mov
Ox4010ba
<main+49>:
mov
Ox4010bd
<main+52>:
add
Ox4010c0
<main+55>:
mov
Ox4010c2
<main+57>:
mov
Ox4010c5
<main+60>:
call
Ox4014d0 <atoi>
šeax, OxffffffE8 (Sebp)
Oxfffffff8 (Sebp), teax
Ox4010ca
<main+65>:
mov
Ox4010cd
<main+68>:
mov
Ox4010d0
<main+71>:
inc
Seax
Ox4010d1
<main+72>:
mov
seax, Ox4 ($esp)
Ox4010d5
<main+76>:
Oxfffffffc (tebp), šeax
mov
Ox4010d8
<main+79>:
add
S0x2, teax
Ox4010db
<main+82>:
mov
šeax, (sesp)
Ox4010de
<main+85>:
call
Ox401050 <what>
šeax, Oxfffffff4 (sebp)
Oxfffffff4 (šebp), teax
Ox4010e3
<main+90>:
mov
Ox4010e6
<main+93>:
mov
(šesp)
seax, Ox4
S0x40107f, (šesp)
Ox4010e9
<main+96>:
mov
Ox4010ed
<main+100>:
movl
Ox4010f4
<main+107>:
call
Ox4014c0 <printf>
Ox401019
<main+112>:
Sox0, teax
mov
Ox4010fe
<main+117>:
leave
Ox4010ff
<main+118>:
ret
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:
1) 11
2) 24
3) 42
4) 66
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
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
- Build a C program that performs the following operations: Declares three pointer variables called iPtr of type int, cPtr of type char, and fFloat of type float Declares three new variables called iNumber of int type, fNumber of float type, and cCharacter of char type Assigns the address of each non-pointer variable to the matching pointer variable Prints the value of each non-pointer variable Prints the value of each pointer variable Printer the address of each non-pointer variable Prints the address of each pointer variablearrow_forwardConvert from C to C++ .Thank you. / include all required libraries#include<stdio.h>#include<stdlib.h>#include<sys/types.h>#include<sys/wait.h>#include<unistd.h> // variable to store number of generationsint num_generations; // function to print the generationsvoid printGeneration(int n){// stop if number of generations are reachedif(n>num_generations)return; // create a forkpid_t p = fork(); // generate new generationsif(p==0)printGeneration(n+1);else if(p>0)wait(0); // wait until child process terminates // print the present generationif(p!=0){// if n is 0if(n==0)printf("Parent. "); // print parent// if n is 1else if(n==1)printf("Child. "); // print child// for all other caseselse{// print grandchildrenfor(int i=0;i<n-2;i++)printf("Great ");printf("Grandchild. ");}// print pid and ppidprintf("pid: %d ppid: %d\n",getpid(),getppid());}} // main functionint main(int argc, char* argv[]){// if no arguments are providedif(argc==1){// print…arrow_forwardThe next two problems introduce command-line arguments. Command-line arguments are commonly used in console-based applications. They afford the operator the ability to execute a program by passing in arguments from the command line. We need add two arguments to our main() The first argument is an int that contains the number of command line arguments, the second argument is an array of char pointers, which contain the actual command line arguments. The command line argument values are stored in an array, and can be accessed to perform different tasks. The first command line argument, argv[0] is always the name of the executable file. The remaining arguments can be accessed by indexing into the array. For example, the next argument would be located in argv[1]. When writing programs with command line arguments, it is important to clarify the program’s usage. This way the operator knows how to execute the program with the correct arguments. Here is an example program where the user enters…arrow_forward
- Writ a program with c++ language to do the following tasks : The user can input one original image and target scales . According to the user’s requirement, this image can resized to the target scale. The program can show the original image and the resized image. *The core function should be Bilinear_interpolation(original image, target height, target width) The output of this function is the resized image and then the user can save it. *You can use image processing libraries to assist your codes, such as Opencv. The functions included in the libraries which are off‐the‐shelf can be used to read images, operate images and save images.arrow_forwardDescribe the concept of serverless computing and its potential applications in cloud-based systems.arrow_forwardIn the code segment Double radius = 4.5; Const double* ptr = & radius;The ptr is constant, but the data pointed to by the pointer ptr is not constant options: True Falsearrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education