1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zavuch27 [327]
4 years ago
7

Given a following C program, where M and N are constant declared with #define long P[M][N]; long Q[N][M]; long sum_element(long

i, long j) { return P[i][j] + Q[j][i]; } In compiling this program, gcc generates the following assembly code: long sum_element(long i, long j) sum_element: leaq 0(,%rdi,8), %rdx subq %rdi, %rdx addq %rsi, %rdx leaq (%rsi,%rsi,4), %rax addq %rax, %rdi movq Q(,%rdi,8), %rax addq P(,%rdx,8), %rax ret What are the values of M and N?
Computers and Technology
1 answer:
sladkih [1.3K]4 years ago
3 0

Answer:

Check the explanation

Explanation:

The first, second and third instruction together set %rdx = 3*%rdi + %rsi. The fourth and fifth instruction set %rdi = %rdi+9*%rsi.

Now %rdi is used to address Q, while %rdx is used to address P. Note that P is addressed by column and then by row. Hence M = 3 . Also Q is addressed by row and then column, hence N = 9 .

You might be interested in
Some files appear dimmed in one of the default folders on your computer. What would be the best course of action? A. Leave the f
Zielflug [23.3K]
If some files appear dimmed in one of the default folders on your computer, the best course of action would be to A. leave the files as they are.
These files are probably either hidden or system files, which are never meant to be deleted or moved.
8 0
4 years ago
You can drag a cell to a new location by pointing to the cell border until the pointer displays a _______ arrow, and then draggi
Marina CMI [18]

The answer for the blank space given in the question is a type of arrow called four-headed arrow.

Four-headed arrow can be found in many computer software and applications, including in Microsoft Excel. Generally, <u>it is used to move an object from one place to another.</u> In the given scenario described at the question, it is used to move a cell from one location to another.

3 0
3 years ago
Read 2 more answers
A gamer typing their name into the computer is an example of:
vova2212 [387]

user input I think I'm not sure though

3 0
3 years ago
Read 2 more answers
The range A2:B4 has how many cells?   A. 2   B. 4   C. 6   D. 8
olya-2409 [2.1K]
The answer to that is D.
3 0
3 years ago
Read 2 more answers
which of these should be reportable diseases to protect public health? A. Obesity B. Diabetes C.Measles D. Lung Cancer
ohaa [14]
It would be measles or obesity
6 0
3 years ago
Read 2 more answers
Other questions:
  • When reading a ____ language, we use our understanding of the richness of the language's vocabulary to extract the meaning. geop
    10·1 answer
  • When you copy text, the selected text is copied from the original location and placed on the
    9·1 answer
  • What class of attacks use innovative attack tools and once a system is infected it silently extracts data over an extended perio
    6·1 answer
  • What is the output of the second println statement in the main method? public class Foo { int i; static int s; public static voi
    14·1 answer
  • Most Muslims are Sunni Muslims; however, the Shiites are a forceful minority in some parts of the Middle East. The Sunni-Shiite
    13·1 answer
  • Which processor family is most likely found on recent gaming laptops (Gaming laptops require a lot of computational power)?
    11·1 answer
  • Which of the following is an advantage of using
    6·2 answers
  • In which drawer can you set certain lights to light up on your micro:bit?
    12·2 answers
  • -) An attribute is a(n)?
    5·1 answer
  • Which arcade game, released in 1972, is considered to be the first to be commercially successful?.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!