The 8051 Instruction Set
1-29 Atmel 8051 Microcontrollers Hardware Manual
4316B–8051–02/04
1.14.6 ANLC,<src-bit>
ANL A,#data
Bytes: 2
Cycles: 1
Encoding: 01010100 immediate data
Operation: ANL
(A) ← (A)
∧ #data
ANL direct,A
Bytes: 2
Cycles: 1
Encoding: 01010010 direct address
Operation: ANL
(direct) ← (direct)
∧ (A)
ANL direct,#data
Bytes: 3
Cycles: 2
Encoding: 01010011 direct address immediate data
Operation: ANL
(direct) ← (direct)
∧ #data
Function: Logical-AND for bit variables
Description: If the Boolean value of the source bit is a logical 0, then ANL C clears the carry flag; otherwise, this instruction
leaves the carry flag in its current state. A slash ( / ) preceding the operand in the assembly language indicates
that the logical complement of the addressed bit is used as the source value, but the source bit itself is not
affected. No other flags are affected.
Only direct addressing is allowed for the source operand.
Example: Set the carry flag if, and only if, P1.0 = 1, ACC.7 = 1, and OV = 0:
MOV C,P1.0 ;LOAD CARRY WITH INPUT PIN STATE
ANL C,ACC.7 ;AND CARRY WITH ACCUM. BIT 7
ANL C,/OV ;AND WITH INVERSE OF OVERFLOW FLAG
ANL C,bit
Bytes: 2
Cycles: 2
Encoding: 10000010 bit address
Operation: ANL
(C) ← (C)
∧ (bit)