Warmup: RISC-V Assembly

1. Which registers contain arguments to functions? For example, which register holds 13 in main’s call to printf?

main 函数中 a0, a1, a2 寄存器保存着调用参数， 13 放在 a2 中。

1. Where is the function call to f from main? Where is the call to g? (Hint: the compiler may inline functions.)

main 函数中直接将调用 f 的结果计算了出来:

1. At what address is the function printf located?

printf 函数的地址为: 48 + 1568 = 1616 = 650(16)

1. What value is in the register ra just after the jalr to printf in main?