subject
Computers and Technology, 23.04.2021 16:00 jhony70

Below there is one function written in C. int fn(unsigned int a, unsigned int b){
if (b == 0)
return b;
else
return (a* fn(a, b - 1));
Below I have changed the high-level C code to output ab and I am providing the assembly code with blank instructions. Assume that a and bare stored in x11 and x12 respectively. Result must be returned in register x11. Also, we assume that the number ab will always fit in a 64-bit register correctly.
You must fill in the blanks. I may have unnecessary blanks in the code, on purpose. Every time you encounter such a blank you will write NO Also, if you need to use registers from one category: saved, temp, arg, you must always start from the lowest indexed register, and increase the index by 1 if you need an additional register. You must store the MINIMUM number of data in the stack. Otherwise you loose points. You may have to use some of the blanks to write 2 or more consecutive instructions TO ONE BLANK ONLY if needed (e. g., for the stack, or for the result).
Example: for the stack you may need to write complete instruction: eg, sd x8, 17(x9) (fictitious regs, nums) for a branch I may give you the instruction opcode and you may only need to complete with the remaining syntax: e. g, x4, Label1 (fictitious register and label) fn: addi sp, sp, - beg Exit addi /Recurse at this point Id x1, Osp) //What else do we need from the stack? Id Id addi mul Exit:

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:00
Match each vocabulary word to its definition.1. desktoppicture used to represent acomputer application2. domainnetwork protectionsoftware code that can be viewed,3. iconmodified, and redistributed for freethe background screen on acomputer monitor4. url5. blogan online journalthe part of an internet address that6. firewallrefers to a group of computers on anetworkonline database of web pages7. intranetnetwork for use by an individual8. open address of a web page or9. wikiresource
Answers: 2
question
Computers and Technology, 23.06.2019 01:30
In deadlock avoidance using banker’s algorithm, what would be the consequence(s) of: (i) a process declaring its maximum need as maximum possible for each resource. in other words, if a resource a has 5 instances, then each process declares its maximum need as 5. (ii) a process declaring its minimum needs as maximum needs. for example, a process may need 2-5 instances of resource a. but it declares its maximum need as 2.
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
You are consulting for a beverage distributor who is interested in determining the benefits it could achieve from implementing new information systems. what will you advise as the first step?
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
What provides an array of buttons for quick access to commonly used commands and tools
Answers: 1
You know the right answer?
Below there is one function written in C. int fn(unsigned int a, unsigned int b){
if (b ==...
Questions
question
Mathematics, 06.05.2020 01:15
question
Mathematics, 06.05.2020 01:15
question
Mathematics, 06.05.2020 01:15
question
Mathematics, 06.05.2020 01:15
question
History, 06.05.2020 01:15
question
English, 06.05.2020 01:15
question
Mathematics, 06.05.2020 01:15
Questions on the website: 13722363