Practice Quiz 10

Trace through the execution of the following assembly language program when the input is 5.
 1. loadI   0 R0
 2. loadI   1 R1
 3. loadI   2 R2
 4. loadI   3 R3
 5. input  I1 R4
 6. output R4 O1
 7. jumpEQ R4 R1 15
 8. rem    R4 R2 R5
 9. jumpEQ R5 R0 13
10. mul    R4 R3 R4
11. add    R4 R1 R4
12. jump    6
13. div    R4 R2 R4
14. jump 6
15. halt