recategorized by
17,728 views
42 votes
42 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

Best answer
49 votes
49 votes

 A stack pointer is a small register that stores the address of the last program request in a stack.

And a nested function (or nested procedure or subroutine) is a function which is defined within another function, the enclosing function. So if there is no stack pointer register then No nested subroutine call possible, hence option B is correct.

selected by
28 votes
28 votes

I think answer is B.

Because in nested subroutine calls we used to push old subroutines into stack and pointing most recent call with stack pointer.

edited by
7 votes
7 votes

It can not have subroutine call instruction ,

For 8085: Stack pointer is a special purpose 16-bit register in the Microprocessor, which holds the address of the top of the stack.

The most typical use of a hardware stack is to store the return address of a subroutine call. When the subroutine is finished executing, the return address is popped off the top of the stack and placed in the Program Counter register, causing the processor to resume execution at the next instruction following the call to the subroutine.

You push items onto the stack and pop them off. In a microprocessor, the stack can be used for both user data (such as local variables and passed parameters) and CPU data (such as return addresses when calling subroutines).

The actual implementation of a stack depends on the microprocessor architecture. It can grow up or down in memory and can move either before or after the push/pop operations.

Operation which typically affect the stack are:

  • subroutine calls and returns.
  • interrupt calls and returns.
  • code explicitly pushing and popping entries.
  • direct manipulation of the SP register.

http://stackoverflow.com/questions/1464035/what-is-a-stack-pointer-used-for-in-microprocessors

http://en.wikipedia.org/wiki/Call_stack

Necessary steps to implement a subroutine  The stack pointer register must be initiali zed ,preferably at the highest memory lo cation of the R/W memory.  The call instruction should be used in the main program accompanied by the RET i nstruction in the subroutine @ http://www.slideshare.net/safinbiswas/stack-in-microprocessor-8085presantation

reshown by
1 votes
1 votes

The answer Is Option A)

Stack pointer register hold the address of top of stack..
Since in subroutine We need to maintain stack pointer to know from where we have come and go back to the same place...
So if no SP then No Subroutine


 

Answer:

Related questions

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