??? 03/08/11 13:30 Read: times |
#181495 - Still looked at the bit capabilities of the processor? Responding to: ???'s previous message |
The 8051 instruction set doesn't have any instruction "return bit from function" or "send bit parameter to function".
But the compiler vendor may decide that one of the flag fields - such as carry - may be a good flag to use to signal a bit result from a function call. And a compiler vendor could define that they want to send a bit parameter in a global flag somewhere or as named flag bits. But sending parameters in named flag bits is problematic since the first arithmetic operation performed inside the function will modify the flag bits. So now you should be able to deduce why the compiler vendor may have decided to allocate a global bit-addressable variable. If you had spent some time looking at all assembler instruction relating to bit operations, you should not write "I think there is nothing special in the instruction set related with this issue." Or actually, you would know that there is nothing special - which is a problem for the compiler. If the compiler doesn't have a good special instruction to use - what should it then use? So besides the special bits in the flags register: What options do the compiler have for accessing bit variables of any kind? |
Topic | Author | Date |
bit type function parameter | 01/01/70 00:00 | |
Look at instruction set | 01/01/70 00:00 | |
What is your actual problem here? | 01/01/70 00:00 | |
main concern is code operation. | 01/01/70 00:00 | |
parameter converted to global variable | 01/01/70 00:00 | |
No reentrancy | 01/01/70 00:00 | |
Is it the 8051 instruction set? | 01/01/70 00:00 | |
Still looked at the bit capabilities of the processor? | 01/01/70 00:00 | |
You need to ask Keil | 01/01/70 00:00 | |
Use bool to simplify | 01/01/70 00:00 | |
BOOLEAN directive used | 01/01/70 00:00 | |
stdbool | 01/01/70 00:00 | |
Use stdbool | 01/01/70 00:00 | |
Optimal implementation | 01/01/70 00:00 | |
SDCC | 01/01/70 00:00 | |
Optimal for what? | 01/01/70 00:00 | |
both | 01/01/70 00:00 |