search
Log In
0 votes
171 views

In a certain computer system, there is special instruction implemented to call subroutines. The instruction is

                JSR Reg.Sub
Microsequence:  Temp ← Sub
                SP ← (SP)+2
                (SP) ← (Reg)
                Reg  ← (PC)
                PC ← (Temp)

Where

  • Temp is an internal CPU register
  • Sub is calling routine address specification
  • Reg is any register in the system
  • SP is stack pointer
  • PC is program counter
  • (SP) refers to the contents of SP.

The system supports indirect addressing and autoincrement addressing modes. PC can be used as a link register. Sub field in the JSR instruction allows any operand specification, including the use of stack pointer along with some addressing modes.

Explain how you would implement co-routine using the JSR instruction. Show the control flow diagram and the contents of the stack before and after the call.

in CO and Architecture
retagged by
171 views

Please log in or register to answer this question.

Related questions

0 votes
0 answers
1
252 views
A certain computer system was designed with cache memory of size $1$ Kbytes and main memory size of $256$ Kbytes. The cache implementation was fully associative cache with $4$ bytes per block. The CPU memory data path was $16$ ... Answer the following questions: What is the hit ratio? Suggest a change in the program size of model to improve the hit ratio significantly.
asked Dec 1, 2016 in CO and Architecture makhdoom ghaya 252 views
0 votes
0 answers
2
291 views
Consider the following grammar for variable declarations: <vardecl> $\rightarrow$ <vardecl><idlist> : <type>; <vardecl> $\rightarrow \in$ <idlist> $\rightarrow$ <idlist>, id <idlist> $\rightarrow$ id <type> $\rightarrow$ integer <type> ... error messages wherever necessary. Make suitable assumptions regarding procedures operating on the symbol table; you need not elaborate upon these procedures.
asked Dec 5, 2016 in Compiler Design makhdoom ghaya 291 views
5 votes
0 answers
3
258 views
It is required to implement a stack using bidirectional shift registers providing stack under flow and overflow detection capability. How many shift registers are needed for a stack capacity of $n$ $k-$bit words? Show the schematic diagram of the implementation, clearly indicating all the data and control lines.
asked Dec 1, 2016 in Digital Logic makhdoom ghaya 258 views
2 votes
1 answer
4
337 views
Provide short answers to the following questions: Express the following list in terms of a linked list structure suitable for internal representation. $(((ab)c)d((e)))$
asked Nov 30, 2016 in DS makhdoom ghaya 337 views
...