We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
How can we do this In assembly we do mov P0, #10001000B
But in Keil how can we do this P0 = 10001000, in binary not by P0 = 0x11; Thank you!
Could move it bit by bit, P0.0 = 1 P0.1 = 0 ... or, could take the whole thing as a string and proceed,
in assembly we have, DB 00010000B, is nt there any equivalent in C,
"in assembly we have, DB 00010000B, is nt there any equivalent in C"
Yes, that was the original question! Review the answers already given, and you will find the answer!
Standard C does not include a notation for integer literals in binary. Decimal, hexadecimal, and octal, yes; binary, no.
I've occasionally seen macro solutions such as that mentioned above. Most C programmers I've known just write the number in hex. The translation from that to binary is fairly easy in your head.