Chapter 5 Instruction Specifications

Item number

Application instructions-6

 

 

Name

 

Rotate right

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ladder format

 

 

 

 

 

 

Condition code

 

 

 

 

Processing time (s)

Remark

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R7F4

 

R7F3

 

R7F2

R7F1

 

R7F0

Average

Maximum

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ROR (d, n)

 

 

DER

 

ERR

 

SD

 

V

 

 

 

C

 

 

 

 

 

 

Upper case: W

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

47

 

 

Lower case: DW

 

 

 

 

 

z

 

 

z

 

 

z

 

z

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction format

 

 

 

 

 

 

Number of steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Condition

 

 

 

Steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ROR (d, n)

 

 

 

 

 

 

 

 

 

 

 

 

 

3

 

 

75

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bit

 

 

 

 

 

 

 

Word

 

Double word

 

Constant

 

 

 

Usable I/O

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Other

 

X

Y

M

 

 

CU, CT

 

WX

WY

WM

 

TC

DX

DY

DM

 

 

 

 

 

 

 

 

R,

 

 

TD, SS,

 

 

 

 

WR,

 

 

 

 

DR,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d

I/O to be rotated

 

 

 

 

 

 

 

 

 

 

{

 

{

 

{

 

{

{

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

n

Number of bits to be

 

 

 

 

 

 

 

 

 

{

{

 

{

 

{

 

 

 

 

{

 

The constant is set in

rotated

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

decimal.

Function

Rotates the contents of d to the right (toward the lower digits) by n bits.

The content of the least significant bit is input to C (R7F0) while the content of C (R7F0) is input to the most significant bit. This is repeated n times.

The content of C (R7F0) is set in the nth bit from the most significant bit.

The content of the nth bit from the least significant bit is set in C (R7F0).

ROR (d, n)

Before execution

 

 

 

 

 

 

d

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After execution

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bn-1

 

B3

B2

B1

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

n bits

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Most significant bit (MSB)

n bits B3 B2 B1

C (R7F0)

Bn

Least significant bit (LSB)

If d is a word:

Designates the shift amount, depending on the contents (0 to 15) of the lower 4 bits (b3 to b0) of n

 

(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)

 

The n (constant) can be set to 0 to 15 (decimal).

If d is a double word:

Designates the shift amount, depending on the contents (0 to 31) of the lower 5 bits (b4 to b0) of n

 

(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)

 

The n (constant) can be set to 0 to 31 (decimal).

Notes

If n is equal to “0,” the rotation is not performed. The previous state is retained in C.

Program example

 

R000 DIF0

 

 

LD

R000

 

R0R (WR0000 ,1 )

 

AND

DIF0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R0R

(WR0000,1)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

]

 

Program description

When R000 rises, WR0000 is shifted to the right by one bit.

At this time, the value of the least significant bit, b0, is set in R7F0, and the value of R7F0 immediately prior to the shift is set in the most significant bit, b15.

5-75

Page 125
Image 125
Hitachi NJI-350B manual Application instructions-6, Rotate right, ROR d, n