AND

Logical AND

AND

AND


[Syntax]

(1)AND src, dest

(2)AND src, src2, dest

 

[Operation]

(1)dest = dest & src;

(2)dest = src & src2;

 

[Function]

-

(1)This instruction logically ANDs dest and src and places the result in dest.

-

(2)This instruction logically ANDs src and src2 and places the result in dest.

 

[Instruction Format]

Syntax

Processng Size

src

src2

dest

Code size

(Byte)

(1)AND src,dst

L

#UIMM:4

-

Rd

2

L

#SIMM:8

-

Rd

3

L

#SIMM:16

-

Rd

4

L

#SIMM:24

-

Rd

5

L

#IMM:32

-

Rd

6

L

Rs

-

Rd

2

L

[Rs].memex

-

Rd

2(memex=UB)

3(memex!=UB)

L

dsp:8[Rs].memex

-

Rd

3(memex==UB)

4(memex==UB)

L

dsp:16[Rs].memex

-

Rd

4(memex=UB)

5(memex!=UB)

(2)AND src,src2,dst

L

Rs

Rs2

Rd

3

 

[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]

AND #15, R2

AND R1, R2

AND [R1], R2

AND [R1].UW, R2

AND R1, R2, R3