
CS5954AM
ADVANCE
INFORMATION
Document #: 38-08025 Rev. **
Page 34 of 44
In addition, there is space for an optional three bit immediate value, which is used in a manner appropriate to the instruction. The
destination field functions exactly as it does in the dual operand operation instructions.
destination:= destination >> count
Flags Affected: Z, C, S
destination:= destination << count
Flags Affected: Z, C, S[37, 38]
Works identically to the SHR instruction, except that the LSB of destination is rotated into the MSB, as opposed to SHR, which
discards that bit
Flags Affected: Z, C, S[39]
Works identically to the SHL instruction, except that the MSB of destination is rotated into the LSB, as opposed to SHL, which
discards that bit
Flags Affected: Z, C, S
destination:= destination + n
Flags Affected: Z, S
destination:= destination – n
Flags Affected: Z, S
destination:= ~destination
(bitwise 1’s complement negation)
Flags Affected: Z, S
Notes:
37. The SHR instruction shifts in sign bits.
38. The C flag is set with last bit shifted out of LSB.
39. The C flag is set with last bit shifted out of MSB.
SHR
bit:
15
14
13
12
11
10
98765432
10
1101000
count-1
destination
SHL
bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
1101001
count-1
destination
ROR
bit:
15
14
13
12
11
10
98765432
10
1101010
count-1
destination
ROL
bit:
15
14
13
12
11
10
98
76
543
21
0
1101011
count-1
destination
ADDI
bit:
15
14
13
12
11
10
9
876543
210
1101100
n-1
destination
SUBI
bit:
15
14
13
12
11
10
9
876
543
210
1101101
n-1
destination
NOT
bit:
15
14
13
12
11
10
9876543210
1101111
000
destination
NEG
bit:
15
14
13
12
11
10
9
876
543
210
1101111
001
destination