I'm doing programming in C51. i'm trying to issue some binary value to P1 (Port 1) of 89c51. I'm not able to issue a binary value. Hex and decimal i know, but how do i issue a binary value. I've tried P1=0b00001111, P1=00001111Y (as given in help file), but non of them works. Please help me out.
xave1200 i think you didn't read my problem carefully. I've mentioned there i know how to put on hex it would had been P1=0x0F; but what in case if i want to mention in binary form.
The Y option will work in entering EXPRESSION for DEBUGGERonly. That option is evaluated by uVision3 (not by c51 compiler). Keil is not specifying any method to use binary constants in applications.
Here are two popular methods you can use.
First Method:
You can write a macro. Look at the following code which defines a macro and uses it:
The compiler evaluates the constant value at compile-time and inserts it into the assembler as a constant. Note that the value will be evaluated at run-time if variables are used in place of 1s or 0s. This may generate a lot of code.
A similar method may be used for unsigned ints and longs.