Instructions
The immediate forms work on R0 only, with an 8-bit immediate that is zero-extended. The byte forms work on memory at R0 + GBR.
| Instruction | Encoding | Chip | What it does |
|---|---|---|---|
and Rm,Rnand #imm,R0 | 0010 nnnn mmmm 10011100 1001 iiiiiiii | SH-1 | Rn = Rn and Rm; R0 = R0 and the zero-extended immediate. |
or Rm,Rnor #imm,R0 | 0010 nnnn mmmm 10111100 1011 iiiiiiii | SH-1 | Rn = Rn or Rm; R0 = R0 or the immediate. |
xor Rm,Rnxor #imm,R0 | 0010 nnnn mmmm 10101100 1010 iiiiiiii | SH-1 | Rn = Rn xor Rm; R0 = R0 xor the immediate. |
not Rm,Rn | 0110 nnnn mmmm 0111 | SH-1 | Rn = the complement of Rm. |
tst Rm,Rntst #imm,R0 | 0010 nnnn mmmm 10001100 1000 iiiiiiii | SH-1 | T = 1 when (Rn and Rm), or (R0 and the immediate), is zero. The registers are not changed. |
and.b #imm,@(R0,GBR) | 1100 1101 iiiiiiii | SH-1 | AND the immediate into the byte at R0 + GBR (a read-modify-write that is not atomic). |
or.b #imm,@(R0,GBR) | 1100 1111 iiiiiiii | SH-1 | OR the immediate into the byte at R0 + GBR. |
xor.b #imm,@(R0,GBR) | 1100 1110 iiiiiiii | SH-1 | XOR the immediate into the byte at R0 + GBR. |
tst.b #imm,@(R0,GBR) | 1100 1100 iiiiiiii | SH-1 | T = 1 when the byte at R0 + GBR and the immediate have no bit in common. |
tas.b @Rn | 0100 nnnn 0001 1011 | SH-1 | Test and set: T = 1 when the byte at Rn is 0; then bit 7 of the byte is set. The read and the write are one indivisible bus operation: the basic lock of multiprocessor code (the two SH-2s of the Saturn). |
Not described
Known, not yet covered
- Reference and viewer: the SH-2A bit-manipulation instructions (
band,bclr,bld,bor,bset,bst,bxor,nott) and the DSP logic instructions.
Unknown
- Reference: none known.