Calling Convention
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
RISC-V Assembly 2
Load and store operations
For the following questions assume that the registers have been initialized as follows:
x1 = 0x00000001
x2 = 0x00000002
x3 = 0x00000003
x4 = 0x00000004
x5 = 0x00000005
Also assume that you are told the contents of a few locations in main memory beginning at address 0x2000. The following notation implies that the value stored at address 0x2000 is 0x0F00FF00, the value stored at address 0x2004 is 0xA0A0A0A0, and the value stored at address 0x2008 is 0x11111111.
. = 0x2000
.word 0x0F00FF00
.word 0xA0A0A0A0
.word 0x11111111
Consider the following sequence of instructions:
lui x1, 2
lw x2, 4(x1)
sw x3, 8(x1)
x2 after executing the instruction lw x2, 4(x1)?
sw x3, 8(x1) instruction?
Sign-Extension
Consider the following sequence of instructions:
addi x2, zero, 0xF2
addi x3, zero, 0xFF4
x2 after execution of this code segment?
x3 after execution of this code segment?
RISC-V Calling Convention
s0-s11 registers are callee-saved registers. This means that: (select all correct answers)