Is the immediate zero-extended?
ANDI immediate forms use a 12-bit signed immediate that is sign-extended to XLEN.
Bitwise AND of rs1 with sign-extended 12-bit immediate, result in rd
ANDI uses opcode 0010011 (0x13), funct3 111. The rs1 field selects the source register, the 12-bit immediate provides the second operand, and rd selects the destination.
ANDI performs bitwise AND of rs1 with the sign-extended 12-bit immediate, writing to rd. Used to clear specific bits (masking), extract bit fields, and implement modulo (when immediate is 2^n-1). The immediate is sign-extended first.
ANDI is a base integer bitwise logical instruction. It operates across XLEN bits; immediate forms use a sign-extended 12-bit immediate.
Understand this scenario with real code like «andi x5, x6, 0xFF # x5 = x6 & 0xFF (extract low byte)».
Understand this scenario with real code like «andi x5, x6, 0xFF # x5 = x6 & 0xFF (extract low byte)».
Understand this scenario with real code like «andi x5, x6, 0xFF # x5 = x6 & 0xFF (extract low byte)».
ANDI immediate forms use a 12-bit signed immediate that is sign-extended to XLEN.
The base integer ISA has no condition-code flags; only rd is written.