Question: 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)

Please answer both 1 and 2 1) 2) Beginning with C code

2)

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

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 statement

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!