Question: Problem 1 ) Given the following instructions and their program addresses: ; in the main program: 0 x 0 0 0 A call ProcA 0
Problem Given the following instructions and their program addresses:
; in the main program:
xA call ProcA
xC inc r
Endmain: rjmp endmain
; inProcA
ProcA:
x rcall ProcB
x push r
xA rcall ProcC
xE pop r
xF ret
; inProcB
ProcB:
x: push R
pop R
xC: Ret
; in ProcC
ProcC:
x push R
x pop R
x RET
Assuming that the value of R is xC R is xA and that the initial state of the stack is:
xB SP
xF
Show the state of the stack, and the values of the PC and SP at each of the following points in
the dynamic execution of the program:
a immediately after executing the instruction at address xA
b immediately after executing the instruction at address x
c immediately after executing the instruction at address x
d immediately after executing the instruction at address xC
e immediately before executing the instruction at address xA
f immediately after executing the instruction at address xA
g immediately after executing the instruction at address x
h immediately before executing the instruction at address x
i immediately after executing the instruction at address x
j immediately before executing the instruction at address xF
k immediately after executing the instruction at address xF
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
