I have this risc v code :
lui S0, 0x1234
ori S1, S0, 0x5678
add S2, S1, S1
and the question asks me, "What does the register S2 hold?"
The question explains that lui
and I quote:
"Load the lower half word of the immediate imm into the upper halfword of register rt. The lower bits of the register are set to 0"
I don't know how to 'compile this program' and what does 0x1234 mean? Thanks
0x1234
is a hexadecimal number equal to4660
(decimal). – user47589ori s1,s0,0x5678
-- immediate operand is 12 bits only (sign extended) – Pavel Smirnov