1Conceptual Review¶
True or False: Types are associated with declaration in C (normally), but are associated with instructions (operators) in RISC-V.
Show Answer
True. See Table 1.
True or False: Since there are only 32 registers, we can’t write RISC-V for C expressions that contain > 32 variables.
Show Answer
False. We have seen a few examples on how to break up longer equations to smaller ones already.
True or False: If
p(stored inx9) were a pointer to an array ofints, thenp++;would be translated toaddi x9,x9, 1.
Solution
False. Don’t forget that ints are 4 bytes wide on RV32I, so instruction would be addi x9, x9, 4.
2Short Exercises¶
True/False:
Solution
True. Explanation