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 1) Given the following instructions and their program addresses:
; in the main program:
0x000A call ProcA
0x000C inc r3
...
End-main: rjmp end-main
; in-ProcA
ProcA:
0x0024 rcall ProcB
0x0025 push r18
...
0x003A rcall ProcC
...
0x003E pop r18
0x003F ret
; in-ProcB
ProcB:
0x0040: push R17
...
pop R17
0x004C: Ret
; in ProcC
ProcC:
0x0054 push R18
...
0x0061 pop R18
0x0062 RET
Assuming that the value of R18 is 0x7C, R17 is 0x9A and that the initial state of the stack is:
0x084B SP
0x085F
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 0x000A.
b) immediately after executing the instruction at address 0x0024.
c) immediately after executing the instruction at address 0x0040.
d) immediately after executing the instruction at address 0x004C.
e) immediately before executing the instruction at address 0x003A.
f) immediately after executing the instruction at address 0x003A.
g) immediately after executing the instruction at address 0x0054.
h) immediately before executing the instruction at address 0x0062.
i) immediately after executing the instruction at address 0x0062.
j) immediately before executing the instruction at address 0x003F.
k) immediately after executing the instruction at address 0x003F.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!