??? 08/25/09 17:10 Read: times Msg Score: +1 +1 Informative |
#168546 - Fast and saves code and RAM space Responding to: ???'s previous message |
Boolean variables are very much used in all computer programs - either for microcontrollers or full PC programs.
A big processor has enough RAM and enough memory bandwidth to use general instructions for working with boolean variables. A PC can use 32-bit or 64-bit variables to store TRUE/FALSE without suffering anything from it. The amount of extra bytes used for code or RAM is insignificant compared to the amount of code and variable space available. Having special instructions that uses a special addressing mode for working with bits, means that the 8051 processor can address a relatively large number of bit variables with tiny instructions. Some of the bit variables are shared with normal bytes of RAM, and some are shared with special function registers, allowing important status bits to be processed one at a time without bothering about the neighbour bits of a SFR. It is way easier to be able to address and respond to the state of a single port pin by direct-addressing it, than to have to load a byte and mask the specific bit before deciding what to do. Not only will you waste code space with multiple instructions, but each instruction will take time. Having bit instructions is a unique feature that can make some 8051 microcontroller applications spank a 32-bit ARM processor running at several times higher clock rate when reaction times are important. |
Topic | Author | Date |
Addressing bit memory indirectly | 01/01/70 00:00 | |
Not possible. | 01/01/70 00:00 | |
so why Bit addressable memory? | 01/01/70 00:00 | |
sure you can and THINK | 01/01/70 00:00 | |
Fast and saves code and RAM space | 01/01/70 00:00 | |
No such instruction... | 01/01/70 00:00 | |
Thanks so much | 01/01/70 00:00 | |
That's _too_ limited... | 01/01/70 00:00 | |
Not vast - actually quite small. | 01/01/70 00:00 | |
bible time | 01/01/70 00:00 | |
store bit address... | 01/01/70 00:00 | |
Thanks | 01/01/70 00:00 | |
if '2051' is the Atmel, then | 01/01/70 00:00 | |
"cable" only for the "S" | 01/01/70 00:00 | |
I second the motion and add | 01/01/70 00:00 | |
I have... | 01/01/70 00:00 | |
Smoking bad for the health | 01/01/70 00:00 | |
an issue many newbies are not aware of is ... | 01/01/70 00:00 | |
NXP??? | 01/01/70 00:00 | |
Design flaw? | 01/01/70 00:00 | |
a feature | 01/01/70 00:00 | |
cheap | 01/01/70 00:00 | |
Code: Addressing bit memory indirectly![]() | 01/01/70 00:00 |