Wednesday, March 23, 2016

8051 Clear Accumulator and Bit

Clear Accumulator
CLR A clears the Accumulator (all bits set to 0). No flags are affected

Encoding: 1 1 1 0 0 1 0 0

The Accumulator contains 5CH (01011100B). The following instruction,

CLR A

leaves the Accumulator set to 00H (00000000B).

Clear bit
CLR bit clears the indicated bit (reset to 0). No other flags are affected. CLR can operate on the carry flag or any directly addressable bit.

CLR C
Encoding: 1 1 0 0 0 0 1 1

CLR bit
Encoding: 1 1 0 0 0 0 1 0 bit address

Port 1 has previously been written with 5DH (01011101B). The following instruction,

CLR P1.2

leaves the port set to 59H (01011001B).



Related topics:
8051 Complement Accumulator and Bit   |   8051 Set Bit   |   8051 Rotate Accumulator   |   8051 Swap Nibble   |   8051 Exchange Accumulator   |   8051 Exchange Digit   |   8051 Push and Pop   |   8051 No Operation

List of topics: 8051

No comments:

Post a Comment