I am trying to load mstatus with another register t1.
lw t1, mstatus # load mstatys register into t1
xori t1, t1, 0x8 # xor mstatus to set 3rd bit and leave everything else as is
lw mstatus, t1 # set mstatus
The initial lw t1, mstatus works just fine. However when trying to lw mstatus, t1 the assembler gives
Error: illegal operands 'lw mstatus, t1'
I have no idea what causes this error, mstatus register is a read/write register. It should work.
sw t1, mstatusoriwould be the correct instruction for setting (xoriwould be for toggling, so its use is inconsistent with the comment).