RACW

Round the accumulator word

RACW

Round ACcumulator Word


[Syntax]

(1)

RACW src

(2)

RACW src, Adest [V2.01.00 or later]

 

[Operation]

(1)

signed long long tmp;

tmp = (signed long long) ACC << src;

tmp = tmp + 0000000080000000h;

if (tmp > (signed long long) 00007FFF00000000h)

ACC = 00007FFF00000000h;

else if (tmp < (signed long long) FFFF800000000000h)

ACC = FFFF800000000000h;

else

ACC = tmp & FFFFFFFF00000000h

 

(2)

signed 72bit tmp;

signed 73bit tmp73;

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

tmp73 = (signed 73bit) tmp + 0000000000080000000h;

if (tmp73 > (signed 73bit) 00000007FFF00000000h)

Adest = 0000007FFF00000000h;

else if (tmp73 < (signed 73bit) 1FFFFFF800000000000h)

Adest = FFFFFF800000000000h;

else

Adest = tmp & FFFFFFFFFF00000000h;

[V2.01.00 or later]

 

[Function]

-

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

-

The RACW 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.

 

[Instruction Format]

Syntax

Operand

Code Size

(Byte)

src

Adest

(1) RACW src

#IMM:1*

(IMM:1 = 1, 2)

3

(2) RACW src, Adest

[V2.01.00 or later]

#IMM:1

(IMM:1 = 1, 2)

A0, A1

3

Note

* For the RX Family assembler manufactured by Renesas Electronics Corp., enter 1 or 2 as the immediate value (IMM:1). The value minus 1 will be stored in the instruction code.

Note

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

 

[Flag Change]

-

This instruction does not affect the states of flags.

 

[Description Example]

RACW #1

RACW #2

RACW #1, A1

RACW #2, A0