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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/19/08 02:50
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#151092 - Value, not SFR address
Responding to: ???'s previous message

anl CFG831,#0BFh


Brian Reid said:
I have been beating my little head against the wall trying to figure out how you came up with "#0BFh" to set the CFG831.6 bit to zero but I can't seem to figure it out. According to the info I have, the SFR address for CFG831 is AFh. Wouldn't bit 1 of the CFG831 SFR be BFh as opposed to bit 6?


The address of the CFG831 SFR is AFh. It is not bit-addressable which means there is no way to access individual bits directly. You must access it on an SFR-wide basis. The quoted example is the same as ANL 0AFh,#0BFh. That instruction will take the value currently in SFR address 0AFh (which is CFG831) and AND it with the value 0BFh.

0BFh is the binary equivalent of 1011 1111 which has every bit set except bit 6. So when you AND BFh with the contents of CFG831, it will effectively clear bit 6 and leave all other bits in their original state.

Regards,
Craig Steiner


List of 42 messages in thread
TopicAuthorDate
Initializing two timers            01/01/70 00:00      
   the infamous intel notation of hexadecimal numbers            01/01/70 00:00      
      thank you!            01/01/70 00:00      
   Aside: Assembler vs Compiler            01/01/70 00:00      
      compiler vs. assembler            01/01/70 00:00      
         Do yourself a favor ...            01/01/70 00:00      
            Symptomatic?            01/01/70 00:00      
            software            01/01/70 00:00      
               bad idea            01/01/70 00:00      
               Good tools make life easier            01/01/70 00:00      
                  software choice            01/01/70 00:00      
                     I see            01/01/70 00:00      
                        Apire            01/01/70 00:00      
         RE: All I know is that I hit the "Compile" button            01/01/70 00:00      
            terminology            01/01/70 00:00      
               sloppy            01/01/70 00:00      
   another question            01/01/70 00:00      
      Is it the priviledge of noobs...            01/01/70 00:00      
         follow up...            01/01/70 00:00      
            read the "bible" and FAQs            01/01/70 00:00      
               interfacing            01/01/70 00:00      
                  ME=mech.engineer is fine...            01/01/70 00:00      
                     ME            01/01/70 00:00      
                     if I was not clear, then            01/01/70 00:00      
                        but does it provide the same comfort...            01/01/70 00:00      
                           so what?            01/01/70 00:00      
                              Is it easy?            01/01/70 00:00      
                                 You answered the question yourself            01/01/70 00:00      
                                    isn't there some lock?            01/01/70 00:00      
                                       actually it is            01/01/70 00:00      
                     thank you everyone!            01/01/70 00:00      
         "not bit addressable" question            01/01/70 00:00      
            Value, not SFR address            01/01/70 00:00      
               perfect!            01/01/70 00:00      
                  yes            01/01/70 00:00      
            did you check "the bible"            01/01/70 00:00      
      PWM ....            01/01/70 00:00      
         I have not see it suggested in this thread            01/01/70 00:00      
         P89V51RD2 instead of AT89S52            01/01/70 00:00      
            P89V51RD2 instead of AT89S52            01/01/70 00:00      
   WHAT are you using            01/01/70 00:00      
      terminology            01/01/70 00:00      

Back to Subject List