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
In Python please:
g100num [7]

Answer:

def compute_pay(number_of_hours, rate_of_pay):

   if number_of_hours > 40:

       pay_for_week = (40*rate_of_pay)+((number_of_hours-40)*\

                                                (rate_of_pay+rate_of_pay*0.5))

   else:

       pay_for_week = number_of_hours*rate_of_pay

   if pay_for_week >= 375:

       print("Paying %d by direct deposit" % pay_for_week)

   else:

       print("Paying %d by mailed check" % pay_for_week)

Explanation:

  1. We define the computer pay function that receives the number of hours worked in a week and the rate of pay
  2. From the test cases we deduce that if a worker works more than 40 hours a week an extra payment is given, you can calculated it as follow: (40 * rate_of_pay) + ((number_of_hours - 40) * (rate_of_pay + rate_of_pay * 0.5))
  3. If a worker works less than 40 hours the payment is calculated as follow: pay_for_week = number_of_hours * rate_of_pay
  4. If the pay for week is equal or greater than 375 we print a payment by direct deposit otherwise we print payment by mailed check

3 0
3 years ago
The text size can be found in ?
Greeley [361]

Answer:

Microsoft word.

Explanation:

i am very sorry if the answer is wrong

3 0
3 years ago
What is the most accurate way to describe the excerpt?
kifflom [539]

choose the option it is a dependent clause

7 0
4 years ago
Read 2 more answers
 Formulas within table cells always begin with
Delicious77 [7]
(D) I don't know about other spread sheet software, but in Microsoft Excel, a formula is always entered beginning with an 'equals' sign. ( = ).
4 0
3 years ago
What is the full meaning of RFID in computer​
Brut [27]

Answer:

radio frequency identification

Explanation:

i thought i had answered this already...?

8 0
3 years ago
Read 2 more answers
Other questions:
  • Teachers in most school districts are paid on a schedule that provides a salary based on their number of years of teaching exper
    10·1 answer
  • Which of the following is least likely checked by the comprehensive component monitor?
    7·1 answer
  • You have just installed the microsoft windows 7 operating system on your pc. which web browser is bundled with windows 7 and is
    12·1 answer
  • What is a close-up shot, and when it is an appropriate shot choice in a film?
    6·1 answer
  • This LEGENDARY character made a much-celebrated comeback in 2017. What was the name of the villain he faced in this epic tale?
    7·2 answers
  • Purpose of this program:
    12·1 answer
  • Help me plzzzz ASAP T-T and it's Cyber Security but my last day of school is tomorrow and I'll graduate in June 24 so plzzzzz I
    12·1 answer
  • Programs which were typically reserved for college-level classes such as computer animation and CAD programs are now being appli
    13·1 answer
  • How to use function in python
    10·1 answer
  • Complete the sentence with the correct response.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!