April 1999
CS202: COMPUTER ARCHITECTURE AND DATA COMMUNICATION

QUESTION 2

Total Marks: 20 Marks

Click here to access other questions

Click to access
SAMPLE STUDENT'S SOLUTIONS
for Question 2

 

(a) In stack operations, what is a binary operation?

 

[2]
(b) Describe the steps involved in using a specific linkage register for passing parameters (at low-level) into a subroutine. Assume [R2] is the specific linkage register.

 

[6]
(c) The use of nested subroutines means that a subroutine can call another subroutine to perform some task.

Given the diagram shown on the following page, for each of the following give the location of the Stack Pointers (SP) and the Program Counter (PC), and, for each subroutine call, give the starting address loaded into the PC when the subroutine call is executed. Assume that the only data stored on the stack is the PC.

 

[12]
(i) before calling SUB1,
(ii) when SUB1 is called,
(iii) before calling SUB2,
(iv) when SUB2 is called,
(v) before calling SUB3,
(vi) when SUB3 is called,
(vii) upon returning from SUB3,
(viii) upon returning from SUB2, and
(ix) upon returning from SUB1.

pic1.gif (7667 bytes)