recategorized by
18,020 views
43 votes
43 votes

Suppose a processor does not have any stack pointer registers, which of the following statements is true?

  1. It cannot have subroutine call instruction
  2. It cannot have nested subroutines call
  3. Interrupts are not possible
  4. All subroutine calls and interrupts are possible
recategorized by

10 Answers

0 votes
0 votes

Ans is B

stack pointer is used to point most recent call while old one i already pushed into stack

0 votes
0 votes
I think we can always use stack using a memory location for stack pointer instead of using register. Ans is D.
0 votes
0 votes
● A subroutine is a reusable program module. A main program can call or jump to the subroutine one or more times.
● The stack is an area of memory; the stack pointer is the address of the last value pushed onto the stack
● The main thing you will be using the stack for is saving data when a subroutine is called.
● You call a subroutine that is going to calculate some value and pass it back to the main program. After you call the subroutine, you can just push all the data onto the stack before executing any instructions in the subroutine. The subroutine can then use all the registers for its internal use and store the data that the main program needs in one of the memory locations. At the end of the subroutine, you can pop the stored data off of the stack and then return control to the main program.
● If stack pointer register is not available then activation records in the stack cannot be created. So it cannot have subroutine call instruction.
0 votes
0 votes
I think answer should be (A)

as we can create an entire stack in main memory with a stack pointer and do all we want to do over there, and answer would be (d)

But as per question setter, he/she doesn’t want us to use auxiliary memory, nor GPR’s neither the MM.

He/She just want us to ask in normal architecture, if we’re not having the SP, will we be able to handle interrupt, subroutine and nester subroutine, answer is obviously no
Answer:

Related questions

23 votes
23 votes
5 answers
1
2 votes
2 votes
1 answer
4