
Instruction Set
4-17
AND
Logical AND
AND
What It Does
AND clears particular bits of a component to 0 according to a mask.
Syntax
Description
AND computes the logical AND of the two operands. If corresponding bits of the operands
are 1, the resulting bit is 1. If either bit or both are 0, the result is 0. The answer replaces
component.
Operation It Performs
Flag Settings After Instruction
Form
Opcode
Description
Clocks
Am186 Am188
AND AL,
imm8
24
ib
AND immediate byte with AL
3
3
AND AX,
imm16
25
iw
AND immediate word with AX
4
4
AND
r/m8,imm8
80
/4 ib
AND immediate byte with r/m byte
4/16
4/16
AND
r/m16,imm16
81
/4 iw
AND immediate word with r/m word
4/16
4/20
AND
r/m16,imm8
83
/4 ib
AND sign-extended immediate byte with r/m word
4/16
4/20
AND
r/m8,r8
20
/r
AND byte register with r/m byte
3/10
3/10
AND
r/m16,r16
21
/r
AND word register with r/m word
3/10
3/14
AND
r8,r/m8
22
/r
AND r/m byte with byte register
3/10
3/10
AND
r16,r/m16
23
/r
AND r/m word with word register
3/10
3/14
AND
component,mask
/* AND component with mask */
component = component & mask;
/* clear overflow and carry flags */
OF = CF = 0;
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Processor Status
Flags Register
reserved
OF DF
IF TF SF ZF
AF
PF
CF
? = undefined; – = unchanged
SF=1 if result is 0 or positive
SF=0 if result is negative
ZF=1 if result equal to 0
ZF=0 if result not equal to 0
PF=1 if low byte of result has even number of set bits
PF=0 otherwise
0
–
–
–
res ? res
res 0
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...