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
dimulka [17.4K]
3 years ago
9

Consider the following high-level recursive procedure: long long int flong long int n, long long int k long long int b b k+2; if

(n=-O) b = 8; else b = b + 4 * n + f(n-1 ,k+1); return b + k; Translate the high-level procedure f into ARMv8 assembly language. · Pay particular attention to properly saving and restoring registers across procedure calls; Use the ARMv8 preserved register convention Clearly comment your code; . Assume that the procedure starts at address 0x00400100; . Keep local variable b in X19; Assume n and k are passed in XO and X1 respectively and that the result is returned in X2
Computers and Technology
1 answer:
Stolb23 [73]3 years ago
8 0

Answer:

f(long long, long long):

push rbp

mov rbp, rsp

push rbx

sub rsp, 40

mov QWORD PTR [rbp-40], rdi

mov QWORD PTR [rbp-48], rsi

mov rax, QWORD PTR [rbp-48]

add rax, 2

mov QWORD PTR [rbp-24], rax

cmp QWORD PTR [rbp-40], 0

jne .L2

mov QWORD PTR [rbp-24], 8

jmp .L3

.L2:

mov rax, QWORD PTR [rbp-40]

lea rdx, [0+rax*4]

mov rax, QWORD PTR [rbp-24]

lea rbx, [rdx+rax]

mov rax, QWORD PTR [rbp-48]

lea rdx, [rax+1]

mov rax, QWORD PTR [rbp-40]

sub rax, 1

mov rsi, rdx

mov rdi, rax

call f(long long, long long)

add rax, rbx

mov QWORD PTR [rbp-24], rax

.L3:

mov rdx, QWORD PTR [rbp-24]

mov rax, QWORD PTR [rbp-48]

add rax, rdx

add rsp, 40

pop rbx

pop rbp

ret

Explanation:

You might be interested in
Who play fortnite gameeeeeeee
son4ous [18]

Answer:

We got a number one victory royale

Yeah, Fortnite, we 'bout to get down (Get down)

Ten kills on the board right now

Just wiped out Tomato Town

My friend just got downed

I revived him, now we're heading south-bound

Now we're in the Pleasant Park streets

Look at the map, go to the marked sheet

Explanation:

4 0
3 years ago
You are using a crimper to attach an RJ-45 connector to a Cat 6 UTP cable. You need to use the T568A standard to connect the ind
tino4ka555 [31]

Answer: The green and white wire (g) should be in pin 1 according to T568A standard.

Explanation: Please see diagram attached.

(source of image: http://www.fiber-optic-components.com/rj45-connector-used-in-ethernet-connectivity.html)

3 0
3 years ago
Declare an array named tax rates of five elements of type double and initialize the elements (starting with the first) to the va
inysia [295]

Answer:

"double tax_rates[5]= {0.10, 0.15, 0.21, 0.28, 0.31};" is the correct answer for the above question.

Explanation:

  • An array is a user-defined data type that is used to define the multiple variables of a single type in a continuous storage location.
  • In the C-programming language, When the user wants to declare an array he needs to define with the help of data type and size of the array with the help of the following syntax-- "Data_type variable_name [size_of_the_array];".
  • When the user wants to initialize the static value in the array then he can do that by the help of following syntax: "Data_type variable_name [size_of_the_array]={first_value,second_value,....,last_value};
  • The above question asked to defined the array of tax_rates name of type double with the above-defined value then he can do that with the help of above-defined syntax (which is defined in the answer part).
4 0
3 years ago
Which character goes at the end of a line of code that starts with if?
weqwewe [10]

Answer:

Explanation:

tttttttttttt

4 0
3 years ago
You are studying for a test tomorrow. Your friends invite you to
lapo4ka [179]

Answer: C

Explanation:

7 0
3 years ago
Other questions:
  • Q3** Write a query to create a new price list for books written by the same author. Allow the user to enter only the first 4 let
    15·1 answer
  • What do radio telescopes use to gather and focus radio waves?
    14·2 answers
  • The name of the opening that lets light into any camera is called ________.
    11·2 answers
  • When you copy text, the selected text is copied from the original location and placed on the
    9·1 answer
  • Which of the following attack is a threat to confidentiality?
    10·1 answer
  • List the five parts of a system.describe them.
    13·1 answer
  • What is one effective way for employees to keep their skillsets current?
    8·2 answers
  • Write a program that asks the p34won to enter their grade, and then prints GRADE is a fun grade. Your program should repeat thes
    7·1 answer
  • Ethan wants to change the font in his document. He should _____.
    8·1 answer
  • 9. Lael wants to determine several totals and averages for active students. In cell Q8, enter a formula using the COUNTIF functi
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!