Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/08/03 12:10
Read: times


 
#60138 - RE: Bit Memory
Responding to: ???'s previous message
Sorry guys, above code has a few syntax errors and bad comments :(

Here is the correct code:
if (bit_addr & 80h)
{
// upper 128 bits, those are in SFRs
byte_addr = bit_addr & 0F8h;
}
else
{
// lower 128 bits, in the bit addreseable area 20-3Fh
byte_addr = (bit_addr >> 3) + 20h ;
}
bit_pos = bit_addr & 7;
bit_pos = 1 << bit_pos; // This is the bit mask
// And byte_addr contains the byte address, you can use R0 or R1 to access it indirectly, and the bit mask to operate on the actual bit.

girish



List of 9 messages in thread
TopicAuthorDate
Bit Memory            01/01/70 00:00      
   RE: Bit Memory            01/01/70 00:00      
      RE: Bit Memory            01/01/70 00:00      
      RE:I\\\'m confused            01/01/70 00:00      
         RE: clearing the confoosion            01/01/70 00:00      
         RE: I'm confused            01/01/70 00:00      
   RE: Bit Memory            01/01/70 00:00      
      RE: Bit Memory            01/01/70 00:00      
         RE: Bit Memory            01/01/70 00:00      

Back to Subject List