Given below is a C function (empty) and a corresponding assembly code generated by some
C compiler.
void
empty(short n, int src, int dest)
{ if (n == 1) print_result();
else empty(n-1,dest,src);
}
_empty: link a6, #0
cmp.w #1, 8(a6)
bne L1
jsr _print_result
jmp L2
L1: move.l 10(a6), -(sp)
move.l 14(a6), -(sp)
move.w 8(a6), d0
subq.l #1, d0
move.w d0, -(sp)
jsr _empty
L2:
L3: unlk a6
rts
Just please help me out asap
I need help with
(a) Drawing a diagram illustrating the contents of the top part of the stack, as seen by function
empty.
(b) Giving a sequence of assembly instructions that can be added between the labels L2 and
L3 to perform the call: empty(n,src-1,dest+1)