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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/17/08 20:56
Read: times


 
#161003 - Just happens?
Responding to: ???'s previous message
This works because 0xD0 XOR 0x07 happens to give the correct address ;-)

But if SFR addresses evenly divisable by 8 are also bit-adressable, that means that all SFR that are bit-adressable have the last 3 bits zero.

xxxxx000 ^ 000 => xxxxx000
xxxxx000 ^ 001 => xxxxx001
xxxxx000 ^ 010 => xxxxx010
xxxxx000 ^ 011 => xxxxx011
xxxxx000 ^ 100 => xxxxx100
xxxxx000 ^ 101 => xxxxx101
xxxxx000 ^ 110 => xxxxx110
xxxxx000 ^ 111 => xxxxx111

So writing <sfr_addr> ^ <bit_number> will always produe the correct bit address.

Maybe a reason why Keil are using this way to define sbit variables?

And the Intel engineers also wanted the simplest possible mapping for bit variables to keep down the number of transistors.

List of 6 messages in thread
TopicAuthorDate
Keil vs SDCC again            01/01/70 00:00      
   that's going backwards            01/01/70 00:00      
   Not the whole story            01/01/70 00:00      
      Outdated too            01/01/70 00:00      
         Just happens?            01/01/70 00:00      
            I doubt it            01/01/70 00:00      

Back to Subject List