Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please answer both 1 and 2 1) 2) Beginning with C code of the following general form: gec generates the following assembly code ( x
Please answer both 1 and 2
1)
2)
Beginning with C code of the following general form: gec generates the following assembly code ( x in \%rdi, y in \%rsi, z in \%rdx, return value placed in %rax) : test: movq % rdi, \%rax andq % rsi, \%rax andq %rdx,%rax jg.L2 imulq \%rsi, \%rax ret .L4 : sarq $2,%rax .L 2 : cmpq \%rsi, \%rax jg.L4 imulq %rdx,%rax ret Re-create the code by filling in the blanks. These questions are about Section 7.6 in your textbook. a. Suppose the files foo.c and bar.c both define (different) functions gribble(), and myprog.c contains a statement that invokes the function gribble(). What will happen if the compiler is invoked as follows? gcc -o myprog myprog.c foo.c bar.c Figure 7.6(b) (b) multvec.o code/link/multvec.c b. In Figure 7.6(b) of your textbook, is the definition of multcnt weak or strong? c. What bad thing can happen if a global variable value is declared with int value; in one file, and with f loat value; in another? Assume a third file declares extern int value, and references the variable in an assignment statementStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started