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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/31/03 10:28
Read: times


 
#47101 - RE: Grabbing a bit from a byte?
Responding to: ???'s previous message
rob it will work for sure, but this will possibly translated to machine code equalant to following assembly code.


when ever you write 'byte << x'
its can translated to either

mov a,byte
rlc a
rlc a
rlc a
x times

or

mov <some register>,x
mov a,byte
rlc a
djnz <some register>,$-1

because 51 is capable of shifting single bit at a time not as an x86 where

mov al,byte
mov cl,x
shl al,cl

will do the job.

this method works where time is in plenty, but inside a ISR or faster speed requirment always better to use mask. or the single move will do as 51 itself capable of processing single bit


abhishek


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