Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribed

2)

image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Nested Relations And Complex Objects In Databases Lncs 361

Authors: Serge Abiteboul ,Patrick C. Fischer ,Hans-Jorg Schek

1st Edition

3540511717, 978-3540511717

More Books

Students also viewed these Databases questions

Question

define the term outplacement

Answered: 1 week ago

Question

describe the services that an outplacement consultancy may provide.

Answered: 1 week ago