Logical Instructions And rd rs rt Nor rd rs rt Or rd rs rt Xor rd rs rt Andi rt rs Imm Ori rt rs Imm Xori rt rs Imm Careful: Immediate variants Zero-extend
Logic Truth Tables AND A B C 1 NOR A B C 1 OR A B C 1 XOR A B C 1
How to Invert Each Bit? (One's complement) Nor rd rs $0 This is not! Nor fuction A B C 0 0 1 0 1 0 1 0 0 1 1 0 A 1 C=A' B=0
Shift Instructions Logical shift left Logical shift right A B C D lost lost B C D 0 0 A B C
Shift Instructions Arithmetic shift right A B C D lost A A B C
Shift Instructions Sll rd rt expr Sra rd rt expr Srl rd rt expr rd := rt shifted by expr (0..31) Sllv rd rt rs Srav rd rt rs Srlv rd rt rs rd := rt shifted by rs (variable)
Rotate Instructions Rotate left Rotate right A B C D A B C D B C D A