1. Bit right offset SHRB
1. Bit right offset SHRB
1.1. Instruction Description
The instruction shifts the operand (S) to the right by (N2) bits into the operand (D) of length (N1). N2 ≤ N1 ≤ Maximum length of operand (D), where operand (S) specifies the lowest bit of its (N2) bit, and operand (D) is moved in from the lowest bit of the (N2) bit specified by operand (S).
| 指令 | SRC | DST | n1 | n2 |
|---|---|---|---|---|
| SHLB | Y0 | M0 | K8 | K2 |
1.1.1. Instruction execution process:
(1)M1,M0 → move out
(2)M3,M2 → M1,M0
(3)M5,M4 → M3,M2
(4)M7,M6 → M5,M4
(5)Y1,Y0 → M7,M6
图1 figure 1.1 Instruction execution process
1.2. The valid operands of the instruction
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| S | ON/OFF | X/Y/C/T/S/M, word positioning (D/V/Z) | address |
| D | ON/OFF | Y/C/T/S/M, word positioning (D/V/Z) | Source |
| N0 | 16 bit integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | length |
| N1 | 16 bit integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | shift |
1.3. Example
command table
NETWORK 000
LD X000
SHRB M0 Y0 K16 K1 // Move Y017 out, then move Y016 into Y017,..., and then move M0 into Y0
图2 SHRB