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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:40, hussain34
Mary's manager told her she should insert a graphic into her documentwrite mary a brief note describing how to insert a graphicin a word processing document.
Answers: 1
image
Computers and Technology, 23.06.2019 15:00, billlyyyyyyyyyy
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
image
Computers and Technology, 24.06.2019 00:40, sierravick123owr441
Use a software program or a graphing utility with matrix capabilities to solve the system of linear equations using an inverse matrix. x1 + 2x2 − x3 + 3x4 − x5 = 6 x1 − 3x2 + x3 + 2x4 − x5 = −6 2x1 + x2 + x3 − 3x4 + x5 = 3 x1 − x2 + 2x3 + x4 − x5 = −3 2x1 + x2 − x3 + 2x4 + x5 = 5
Answers: 3
image
Computers and Technology, 24.06.2019 07:00, jordaaan101
Guys do you know sh27 cause he hacked me : ( pidgegunderson my old user
Answers: 2
You know the right answer?
Below there is one function written in C. int fn(unsigned int a, unsigned int b){
if (b ==...

Questions in other subjects:

Konu
English, 06.11.2020 20:50
Konu
Mathematics, 06.11.2020 20:50