i am having problem in understanding the following bit of PSW of microcontroller 8051:
first, AC (auxiliary carry flag) that it is set if a carry was generated out of bit 3 into bit 4. THIS BART i really don't understand, if we take for example 55H + AAH
second, flag0 how i know it's set or not
third, PSW D1(--) please tell me what is it cause i haven't seen any explanation about it.
The auxiliary carry is used in BCD arithmetic. I've never had to do that on an 8051 so I've never used it. You might also checkout the The Decimal Adjust Accumulator instruction.
DA A
which is helpful in doing BCD arithmetic. In 30 years of 8051 programming I've never had occasion to use that instruction either.
Here a carry was generated out of bit 3 into bit 4, where bit 0 is the LSB.
This will always happen if the result of adding two nibbles is greater than 15.
The auxiliary carry is used in BCD arithmetic. I've never had to do that on an 8051 so I've never used it. You might also checkout the The Decimal Adjust Accumulator instruction.
DA A
which is helpful in doing BCD arithmetic. In 30 years of 8051 programming I've never had occasion to use that instruction either.
you mean its not used in programming the µc, actually i am studying and i want to understand how it work, beside that i haven't started yet the programming part.
Here a carry was generated out of bit 3 into bit 4, where bit 0 is the LSB.
This will always happen if the result of adding two nibbles is greater than 15.
you mean its not used in programming the µc, actually i am studying and i want to understand how it work, beside that i haven't started yet the programming part.
If you don't need to do BCD arithmetic, then the AC(Auxiliary Carry) is useless and unused. If you do need to do BCD arithmetic then it could be useful.