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.
Question
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.
Solution
c. The return address.
Similar Questions
When a subroutine is called, the address of the instruction following the CALL instruction is stored in/on the a) stack pointerb) accumulatorc) program counterd) stack
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.
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.
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
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.