Out: Friday, 14 January
Due: Friday, 21 January
Turnin: Gradescope
This is a "paper and pencil" assignment about data and instruction representation. Turn-in is online, preferably as a pdf file.
.text
addi x10, x10, 21
andi x11, x10, 6
xor x12, x10, x11
lw x13, X(x0)
slli x14, x13, 1
and x14, x14, x13
done:
.data
X: .word 49
You may find the RISC-V resources referenced in the course documentation page to be useful.
NOTE: The actual RISC-V lw instruction
differs from the one described in class and implemented by the simulator. For this question, assume that addresses in the .data
section start at 0, and that the effective address generated by a lw is the address (index) of a word in the data section, exactly as it works in our simulator.
fd010113
02112623
add x10,x11,x12
slti x13, x12, 0
slt x14, x10, x11
bne x13, x14, skip
...
skip:
What is the purpose of the three instructions that follow the add instruction?