There is a bug in the following RISC-V program, which aims to execute a subroutine that adds two numbers:
MAIN2 LA t3, L2
A2 J t3
addi a0,x0,10
ecall
L2 ADD t2, t1, x0
RET
1. Why does the program not behave as expected? What actually happens?
2. Fix the bug by only modifying the code in the main block (i.e. before L2).
3. Fix the bug by only modifying the code in the subroutine (i.e. L2 and after)