RDACW

Round the accumulator word [V2.01.00 or later]

RDACW

Round Down ACcumulator Word


[Syntax]

RDACW src, Adest

 

[Operation]

signed 72bit tmp;

tmp = (signed 72bit) Adest << src;

if (tmp > (signed 72bit) 0000007FFF00000000h)

Adest = 0000007FFF00000000h;

else if (tmp < (signed 72bit) FFFFFF800000000000h)

Adest = FFFFFF800000000000h;

else

Adest = tmp & FFFFFFFFFF00000000h;

 

[Function]

-

This instruction rounds the value of the accumulator into a word and stores the result in the accumulator.

-

The RDACW instruction is executed according to the following procedures.

Processing 1:

The value of the accumulator is shifted to the left by one or two bits as specified by src.

Processing 2:

The value of the accumulator changes according to the value of 64 bits after the contents have been shifted to the left by one or two bits.

-

You can assemble assembly-language code that includes this instruction if you have specified the assembler option -isa with selection of the instruction set of the RXv2 or a later version.

 

[Instruction Format]

Syntax

Operand

Code Size

(Byte)

src

Adest

RDACW src, Adest

#IMM:1

(IMM:1 = 1, 2)

A0, A1

3

Note

Specify A0 (ACC0) or A1 (ACC1) as Adest.

 

[Flag Change]

This instruction does not affect the states of flags.

 

[Description Example]

RDACW #1, A1

RDACW #2, A0