Download C500 Architecture and Instruction Set

Transcript
C500
Instruction Set
ANL
C, <src-bit>
Function:
Logical AND for bit variables
Description:
If the Boolean value of the source bit is a logic 0 then clear the carry flag;
otherwise leave 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 bit 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
ANL
ANL
C,P1.0 ; Load carry with input pin state
C,ACC.7 ; AND carry with accumulator bit 7
C,/OV
; AND with inverse of overflow flag
ANL
C,bit
Operation:
ANL
(C) ← (C) ∧ (bit)
Encoding:
1 0 0 0 0 0 1 0
Bytes:
2
Cycles:
2
ANL
C,/bit
Operation:
ANL
(C) ← (C) ∧ / (bit)
Encoding:
1 0 1 1 0 0 0 0
Bytes:
2
Cycles:
2
User’s Manual
bit address
bit address
4-19
2000-07