Closed nishtahir closed 1 year ago
Running this instruction seems to generate a compile error
addi x1, x0, 2048 file.s: Assembler messages: file.s:6: Error: illegal operands `addi x1,x0,2048'
However, running this seems to work just fine.
addi x1, x0, 1024 OK!
I could be wrong, but I believe the immediate value should be 12 bits long.
You're correct, indeed it has 12 bit, but its a sign extended imediate value, so the range is - 2048 to 2047
Oh, I see. I forgot that the assembly value is signed. Thanks for clearing that up for me 😄.
Running this instruction seems to generate a compile error
However, running this seems to work just fine.
I could be wrong, but I believe the immediate value should be 12 bits long.