SL[ 0 1 X A ] sX — Shift Left Register sX

R

Example

RR sX; Rotate right. Bit sX[0] copied into CARRY

Pseudocode

CARRY Å sX[0]

sX Å {sX[0], sX[7:1]}

if ( sX = 0 ) then

ZERO Å 1 else

ZERO Å 0 endif

PC Å PC + 1

Registers/Flags Altered

Registers: sX, PC

Flags: CARRY, ZERO

SL[ 0 1 X A ] sX — Shift Left Register sX

There are four variants of the shift left instruction, as shown in Table C-7, that operate on any single data register. Each bit in the specified register is shifted left by one bit position. The most-significant bit, bit 7, shifts into the CARRY bit. The last character of the instruction mnemonic—i.e., ‘0’, ‘1’, ‘X’, or ‘A’—indicates the value shifted into the least- significant bit, bit 7.

Table C-7:Shift Left Operations

 

 

 

 

 

 

 

 

Shift Left

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SL0 sX

 

 

 

 

 

Shift Left with ‘0’ fill.

 

 

 

 

 

 

 

CARRY

 

 

Register sX

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

‘0’

 

 

 

 

 

 

7

6

5

4

3

 

2

1

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SL1 sX

 

 

 

 

 

Shift Left with ‘1’ fill.

 

 

 

 

 

 

 

CARRY

 

 

Register sX

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

‘1’

 

 

 

 

 

 

7

6

5

4

3

 

2

1

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SLX sX

 

 

 

 

 

Shift Left, eXtend bit 0.

 

 

 

 

 

CARRY

 

 

Register sX

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

6

5

4

3

 

2

1

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SLA sX

Shift Left through All bits, including CARRY.

CARRY

 

Register sX

 

 

7

6

5

4

3

2

1

0

The ZERO flag is always 0 after executing the SL1 instruction because register sX is never zero.

PicoBlaze 8-bit Embedded Microcontroller

www.xilinx.com

109

UG129 (v1.1.2) June 24, 2008

Page 109
Image 109
Xilinx UG129 manual SL 0 1 X a sX Shift Left Register sX, Table C-7Shift Left Operations