For an assembler implementation of the routine that is written according to the WRAMPApplication Binary Interface (ABI):int max(int a, int b)that returns the maximum value stored in parameters a and b and uses the general purposeregisters $3 and $4 to determine that answer, but makes no further subroutine calls itself,fill out the diagram below showing the state of the stack-frame just before calling max()where parameter a is value 1, parameter b is value 2, register $3 has value 3 and register $4has value 4. Note, not all of these values are necessarily on the stack when max() is called.(2 marks)+0+1+2+3+412
Question
For an assembler implementation of the routine that is written according to the WRAMPApplication Binary Interface (ABI):int max(int a, int b)that returns the maximum value stored in parameters a and b and uses the general purposeregisters 4 to determine that answer, but makes no further subroutine calls itself,fill out the diagram below showing the state of the stack-frame just before calling max()where parameter a is value 1, parameter b is value 2, register 4has value 4. Note, not all of these values are necessarily on the stack when max() is called.(2 marks)+0+1+2+3+412
Solution
I'm sorry, but your question seems to be incomplete. Could you please provide the diagram or more details about the stack-frame you want me to fill out?
Similar Questions
or the following excerpt of WRAMP assembly code, what are the final values stored in $2and $3?(2 marks)addi $2, $0, 0x42addi $3, $0, 0x42andi $2, $2, 0xF0andi $2, $2, 0xF0xori $3, $3, 0xF0xori $3, $3, 0xF0$2 = _______0x40____________$3 = _______0x42____________
Is it possible for a subroutine to comply with the WRAMP ABI conventions without decrementing/incrementing the stack pointer $sp at all?Question 3Select one:a.No.b.Yes, provided that it only modifies registers that are not being used elsewhere in the program.c.Yes, but it would have to return immediately without executing any instructions other than "jr $ra".d.Yes, provided that it does not modify any registers except $1, and does not call further subroutines.
If a WRAMP subroutine takes three parameters, what will the stack pointer be pointing at when that subroutine is first entered (i.e. before any instructions have been executed)?Question 11Select one:a.The first parameter.b.The last (third) parameter.c.The return address.d.The first instruction.
ssume that a suitable stack frame has already been created, and you are preparing to call another subroutine. Which WRAMP assembly instruction would place the first parameter onto the stack?Question 4Select one:a.push $1b.sw $sp, 0($1)c.push $spd.sw $1, 0($sp)
What do WRAMP subroutines use the system stack for?Question 14Select one:a.Saving/restoring register values, passing parameters to other subroutines, and storing all local variables.b.Passing parameters to other subroutines, saving/restoring registers, and returning values to the caller.c.Saving/restoring register values, passing parameters to other subroutines, and storing any local variables that don't fit into registers.d.A general area of memory for storing data.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.