R

Appendix : PicoBlaze Instruction Set and Event Reference

Examples

SL0 sX; Shift left. 0 shifts into LSB, MSB shifts into CARRY.

SL1 sX; Shift left. 1 shifts into LSB, MSB shifts into CARRY.

SLX sX; Shift left. LSB shifts into LSB, MSB shifts into CARRY.

SLA sX; Shift left. CARRY shifts into LSB, MSB shifts into CARRY.

Pseudocode

case (INSTRUCTION) when “SL0”

LSB Å 0 when “SL1” LSB Å 1 when “SLX”

LSB Å sX(7) when “SLA”

LSB Å CARRY end case

CARRY Å sX[7]

sX Å {sX[6:0], LSB}

if ( sX = 0 ) then

ZERO Å 1 else

ZERO Å 0 endif

PC Å PC + 1

Registers/Flags Altered

Registers: sX, PC

Flags: CARRY, ZERO

SR[ 0 1 X A ] sX — Shift Right Register sX

There are four variants of the shift right instruction, as shown in Table C-8, that operate on any single data register. Each bit in the specified register is shifted right by one bit position. The least-significant bit, bit 0, 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 most- significant bit, bit 7.

110

www.xilinx.com

PicoBlaze 8-bit Embedded Microcontroller

 

 

UG129 (v1.1.2) June 24, 2008

Page 110
Image 110
Xilinx UG129 manual SR 0 1 X a sX Shift Right Register sX