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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/01/03 17:29
Read: times


 
#47182 - RE: Grabbing a bit from a byte?
Responding to: ???'s previous message
Okay, so this will work?

bit mybit;
unsigned char mychar;
unsigned char mymask;

mychar = 0xFF;
mymask = 0x02; //I want to get bit 1
mybit = mychar & mymask;

I need the most efficient way to do this, as it'll be in the ISR.

Now i heared that the accumulator is bit addressable?
so is this also possible?

mov a, 0xFF
mov c, a.1
mov _mybit, c

Mas

List of 10 messages in thread
TopicAuthorDate
Grabbing a bit from a byte?            01/01/70 00:00      
   RE: Grabbing a bit from a byte?            01/01/70 00:00      
   RE: Grabbing a bit from a byte?            01/01/70 00:00      
      RE: Grabbing a bit from a byte?            01/01/70 00:00      
         RE: Grabbing a bit from a byte?            01/01/70 00:00      
            RE: Grabbing a bit from a byte?            01/01/70 00:00      
         RE: Grabbing a bit from a byte?            01/01/70 00:00      
            RE: Grabbing a bit from a byte?            01/01/70 00:00      
            RE: Grabbing a bit from a byte?            01/01/70 00:00      
   RE: Grabbing a bit from a byte?            01/01/70 00:00      

Back to Subject List