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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/20/02 18:53
Read: times


 
#21029 - RE: bit array in C (for 8051)
The problem here is the magical word ARRAY.

When you create an array the compiler MUST use math to figure out the location of BIT_ARRAY[23]. This is EASY for the compiler.

However, the 8051 does not have an instruction that lets you set a bit based on an index. You only have SETB and CLR. And, these instructions REQUIRE a fixed address. This should also explain why pointers to bits aren't supported. It's impossible!

I guess that a self-modifying program could be created. However, that means that you must have some von Neumann RAM in your architecture. And, few 8051 systems incorporate that.

Jon Ward
Keil Software


List of 14 messages in thread
TopicAuthorDate
bit array in C (for 8051)            01/01/70 00:00      
RE: bit array in C (for 8051)            01/01/70 00:00      
RE: bit array in C (for 8051)            01/01/70 00:00      
RE: bit array in C (for 8051)            01/01/70 00:00      
RE: bit array in C (for 8051)            01/01/70 00:00      
RE: bit array in C (for 8051)            01/01/70 00:00      
RE: bit array in C (for 8051)            01/01/70 00:00      
RE: bit array in C (for 8051)            01/01/70 00:00      
RE: bit array in C (for 8051)            01/01/70 00:00      
RE: bit array in C (for 8051)            01/01/70 00:00      
RE: bit array in C (for 8051)            01/01/70 00:00      
RE: bit array in C (for 8051)            01/01/70 00:00      
RE: bit array in C (for 8051) - Kapil            01/01/70 00:00      
Bit pointers in C51            01/01/70 00:00      

Back to Subject List