Theo v. Werkhoven wrote:
Sat, 20 Jan 2007, by robin.listas@telefonica.net:
The Saturday 2007-01-20 at 11:26 +0100, Theo v. Werkhoven wrote:
Well, my instructors in the early '70's told me that a byte was analogous to "bite" -- not the smallest "bit" accessible, but smaller than the full-size "word" of most architectures of the time. And some architectures do allow you direct access to a bit. Why only some? Aren't shift- and logical operations part of all CPU architectures? That's not direct access to a bit, IMO. Direct access would be an operation that would load into a register a certain bit, or another that would compare directly to a certain bit in a byte in memory (in one op). I have never seen it, though.
That would be rather inefficient opcodes I think, and I can't think of any circumstance where that would be neccesary. Perhaps that's why you don't see it.
Hardware-intensive control requires bit testing and setting. Several microprocessors used opcodes like "bittest {address}, bitno" to test a single bit in a single instruction with only a single memory or I/O access to the target address. They had a corresponding "bitset" operation, too. This was important when memory was expensive and small, and when processors were slow. What's inefficient from that point of view is the modern memory-only access, requiring loading a bitmask, loading the target address, operation, storing the result. Of course, now that memory is nearly infinite for nearly zero cost, processors are lightspeed fast, and compilers have replaced assemblers as the programming environment of choice, "efficiency" has flip-flopped. -- John Perry -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org