Tuesday, March 22, 2016

8051 Move Bit

Move Bit – MOV dest-bit,src-bit

MOV dest-bit,src-bit copies the Boolean variable indicated by the second operand into the location specified by the first operand. One of the operands must be the carry flag; the other may be any directly addressable bit. No other register or flag is affected.

MOV C,bit
Encoding:10100010 bitaddress

MOV bit,C
Encoding:10010010 bitaddress

Example:
ORG 0H; start (origin) at location 0
MAIN :
MOV C, 22h ; copy contents of bit variable 22h in to C
MOV 22h, C; copy contents of C in to 22h
MOV P1.3,C; copy contents of C in to P1.3
MOV C,P3.3; copy contents of P3.3 in to C
END; end of asm source file



Related topics:
8051 Move Byte   |   8051 Move Word   |   8051 Move Code Byte   |   8051 Move External   |   8051 MOVX Instruction   |   8051 MOVC Instruction   |   8051 MOV Instruction

List of topics: 8051

No comments:

Post a Comment