Next: , Previous: Conversion operators, Up: MIX instruction set


2.1.2.10 Shift operators

The following instructions perform byte-wise shifts of the contents of `rA' and `rX'.

SLA
SRA
SLAX
SRAX
SLC
SRC
Shift rA or rAX left, right, or rAX circularly (see example below) left or right. M specifies the number of bytes to be shifted. OPCODE = 6, MOD = 0, 1, 2, 3, 4, 5.
If we begin with, say, `[rA]' = - 01 02 03 04 05, we would have the following modifications to `rA' contents when performing the instructions on the left column:

SLA 2 [rA] = - 03 04 05 00 00
SLA 6 [rA] = - 00 00 00 00 00
SRA 1 [rA] = - 00 01 02 03 04
Note that the sign is unaffected by shift operations. On the other hand, `SLC', `SRC', `SLAX' and `SRAX' treat `rA' and `rX' as a single 10-bytes register (ignoring again the signs). For instance, if we begin with `[rA]' = + 01 02 03 04 05 and `[rX]' = - 06 07 08 09 10, we would have:

SLC 3 [rA] = + 04 05 06 07 08 [rX] = - 09 10 01 02 03
SLAX 3 [rA] = + 04 05 06 07 08 [rX] = - 09 10 00 00 00
SRC 4 [rA] = + 07 08 09 10 01 [rX] = - 02 03 04 05 06
SRAX 4 [rA] = + 00 00 00 00 01 [rX] = - 02 03 04 05 06