??? 03/28/07 01:16 Read: times |
#135992 - you want NOT? Responding to: ???'s previous message |
I don't know what you want to negate.
In hardware, there are "NOT" gates, more commonly called inverters. In 8051 code, you could use CPL for compliment, but I don't think it will work directly on the registers. but if you do "CPL A", you would be reversing all of the bits. The simplest way to do the math is to take the value of "A" away from 255 and then you will get what CPL returns. I think CPL also works on individual bits as well, so that you can do a true "NOT" operation on them. Somewhere in the middle of 8051 internal ram (I think locations 20h to 2Fh), there are a set of bytes that are bit addressable. then you can reference each bit of a byte the same way you reference each bit of a port. (add ".x" where x is the bit number from 0 to 7.). What are you trying to do that involves inversion? |
Topic | Author | Date |
How come there isn't a NOT instruction ? | 01/01/70 00:00 | |
CPL? | 01/01/70 00:00 | |
hahaha | 01/01/70 00:00 | |
google? | 01/01/70 00:00 | |
the beauty of an index is ... | 01/01/70 00:00 | |
I did | 01/01/70 00:00 | |
NOT vs CPL | 01/01/70 00:00 | |
Complement | 01/01/70 00:00 | |
Sigh, you're right | 01/01/70 00:00 | |
Your the Best Carry Bit Ever!! (NM) | 01/01/70 00:00 | |
You can do | 01/01/70 00:00 | |
you want NOT? | 01/01/70 00:00 | |
why do you 'think' | 01/01/70 00:00 | |
well.. CPL works | 01/01/70 00:00 | |
Bit Masking | 01/01/70 00:00 | |
it is right there | 01/01/70 00:00 | |
I'll look into Bit masking![]() | 01/01/70 00:00 |