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
What are the two major categories of computer software? word-processing software and spreadsheet software applications software
Strike441 [17]
From this list, the most used software would be:

Word-processing software and spreadsheet software.
5 0
4 years ago
How do l write a program which countdown from 10 to 3​
earnstyle [38]

Answer:

use loop

for(int i =10;i>2; i--)

{

System.out.println(i+"\n")

}

4 0
3 years ago
This type of headline sits next to a story.<br> Banner<br> Slammer<br> Hammer<br> Sidesaddle
ioda

Answer:

banner...............

7 0
3 years ago
Read 2 more answers
What does the program print out as a result of the given snippet of code?
dexar [7]

Answer:

5

Explanation:

well the function len gives the length of the list

so the length of supplies is

5

7 0
3 years ago
Read 2 more answers
It is used to replace numeric number of a website​
vampirchik [111]

greatflombles or gr8flombles or go2flombles

5 0
4 years ago
Other questions:
  • Assume the availability of a function called printStars. The function receives an integer value as an argument. If the argument
    8·1 answer
  • Your friends parents are worried about going over their budget for the month. Which explains would you suggest is not a need.
    14·2 answers
  • Who is responsible for customer service?
    14·1 answer
  • Can you please help me by sending a proposal onnanotechnology in networking applications
    8·1 answer
  • To save a file so that it can be opened on most computers, select the ____ option.
    10·2 answers
  • Had you guys go to prom by yourself or someone in your senior class
    5·2 answers
  • What animal does maleficent transform into in order to defeat prince phillip?
    13·2 answers
  • How do I install another part on campaign call of duty cold war? please help.(best answer will get branliest.)
    15·2 answers
  • if you are trying to reduce the cost of college, which of the following strategies is likely to save you the most money?
    9·1 answer
  • HELP PLEASE!!!!!!!!!<br> Please fix the coding! thanks I give brainliest
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!