Computers and Technology
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:

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 20:00, jayjay5246
What is the term for water wave that is created by an underwater earthquake
Answers: 1
image
Computers and Technology, 22.06.2019 23:00, brooklynmikestovgphx
Suppose s, t, and w are strings that have already been created inside main. write a statement or statements, to be added to main, that will determine if the lengths of the three strings are in order by length, smallest to largest. that is, your code should determine if s is strictly shorter than t, and if t is strictly shorter than w. if these conditions hold your code should print (the boolean value) true. if not, your code should print false. (strictly means: no ties) example: if s, t, and w are "cat", "hats", and "skies" your code should print true - their lengths are 3-4-5; but if s, t, and w are "cats" "shirt", and "trust", then print false - their lengths are 4-5-5 enter your code in the box below
Answers: 2
image
Computers and Technology, 22.06.2019 23:30, Molly05
In my email i got a message it says a quick message and in message details on who its from its says nicole and under nicole is 50e0bf08e5b671@ualwgypg91wa5wl. uzo9kbud3qjwddygd5.vng -
Answers: 1
image
Computers and Technology, 25.06.2019 05:20, andrealeon2000
6. write a user-defined matlab function for the following math function: r() = 4cos(4sin ) the input to the function is  (in radians) and the output is r. write the function such that  can be a vector. a) use the function to calculate r(/6) and r(5/6). b) use the function to plot (polar plot) r() for 0 ≤  ≤ 2. hint: use “ polar” and/or for “polar plot in matlab." include the title “'r(\theta)=4cos(4sin(\theta))”
Answers: 1
Do you know the correct answer?
Below there is one function written in C. int fn(unsigned int a, unsigned int b){
if (b ==...

Questions in other subjects:

Konu
Biology, 31.03.2020 02:43