96 / 132 page

Handshake Solutions
HT80C51 User Manual
80C51 Family Instruction Set – Instruction definitions
Page 96 of 132
© Philips Electronics N.V. 2005
ANL C,<src-bit>
Function: Logical-AND for bit variables
Description: If the Boolean value of the source bit is a logical 0 then clear the carry flag; otherwise leave the
carry flag in its current state. A slash (“/”) preceding the operand in the assembly language indi-
cates 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:
Operation: ANL
(C)
← (C) ∧ (bit)
ANL C,/bit
Bytes: 2
Cycles: 2
Encoding:
Operation: ANL
(C)
← (C) ∧ ¬(bit)
1
0
0
0
0
0
1
0
bit address
1
0
1
1
0
0
0
0
bit address