XOR

Logical exclusive or

XOR

eXclusive OR logical


[Syntax]

(1)

XOR src, dest

(2)

XOR src, src2, dest [V3.00.00 or later]

 

[Operation]

(1)

dest = dest ^ src;

(2)

dest = src2 ^ src; [V3.00.00 or later]

 

[Function]

(1)

This instruction exclusive-ORs dest and src and places the result in dest.

(2)

This instruction exclusive ORs src2 and src and places the result in dest. 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 RXv3 or a later version. [V3.00.00 or later]

 

[Instruction Format]

Syntax

Processng Size

Operand

Code Size

(Byte)

src

src2

dest

(1) XOR src, dest

L

#SIMM:8

Rd

4

L

#SIMM:16

Rd

5

L

#SIMM:24

Rd

6

L

#IMM:32

Rd

7

L

Rs

Rd

3

L

[Rs].memex

Rd

3 (memex == UB)

4 (memex != UB)

L

dsp:8[Rs].memex*

Rd

4 (memex == UB)

5 (memex != UB)

L

dsp:16[Rs].memex*

Rd

5 (memex == UB)

6 (memex != UB)

(2) XOR src, src2, dest

[V3.00.00 or later]

L

Rs

Rs2

Rd

3

Note

* For the RX Family assembler manufactured by Renesas Electronics Corp., enter a scaled value (the actual value multiplied by 2 when the size extension specifier is .W or .UW, or by 4 when the specifier is .L) as the displacement value (dsp:8, dsp:16). With dsp:8, values from 0 to 510 (255 × 2) can be specified when the size extension specifier is .W or .UW, or values from 0 to 1020 (255 × 4) when the specifier is .L. With dsp:16, values from 0 to 131070 (65535 × 2) can be specified when the size extension specifier is .W or .UW, or values from 0 to 262140 (65535 × 4) when the specifier is .L. The value divided by 2 or 4 will be stored in the instruction code.

 

[Flag Change]

Flag

C

Z

S

O

Change

 

 

Conditions

Z : The flag is set if dest is 0 after the operation; otherwise it is cleared.

S : The flag is set if the MSB of dest after the operation is 1 ; otherwise it is cleared.

 

[Description Example]

XOR #8, R1

XOR R1, R2

XOR [R1], R2

XOR 16[R1].L, R2

XOR R1, R2, R3