Dear all, I want to access some continus bit,let me can modify the value,such as, for(i = 0 ; i < 10 ; i++) { bit[i] = ?; } but you know,the bit var cann't build as a array in keil c51,but build some boolean var with byte will speed down the MCU and more code,Who can give me a good advice and a way,Thanks in advance.
you could try copying your byte into a bit-addressable temporary variable? you'd have to examine for yourself whether that's advantageous in your particular application.
Thanks every one in this message which give it a glance. But the way on above all is convert the bit array to a byte array,You compile the code will generate the asm code,all op code will be translated to byte operating mode,but you know,if we had build a array,and the member in the array is bit addressable var,some jump op will be translated as ,jb or jbc or jz and so on,this way will run more quickly and few code space,I had found no way to do this work,and I thinks embeding a piece asm code will be one way to resolve it. Waiting your good advice.
Paddy, your explanation is not at all clear, but it appears that you want the 8051 to do something which it just cannot. There is no "bit pointer" functionality in the 8051 design. If you want to access an array, then the assembler code has no choice but to use byte operations to access the required bit.
View all questions in Keil forum