Search code examples
assembly8051microprocessors

What will happen if we store a value in carry register in 8051?


When I write this code in 8051 simulator:

MOV 07h, #45h
MOV C, 07h

It works and make the carry bit zero. But what does this code do, and why carry bit is zero?


Solution

  • What you are observing is accidental. The 07h in the two instructions is not the same. The first one is byte address, the second one is bit address which is actually the most significant bit of byte address 20h.