Search code examples
assemblyriscvones-complementriscv32

What does "not" mean in Assembly-RiscV?


What does not mean in RiscV? I got it after translating some code from C like this:

not     a0, t1

Solution

  • not is not part of the instruction set but some assemblers may use it as a shorthand. It compiles as xori a0, t1, -1 which means it will invert every bit in the register and store the result in the target.