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.
If I execute an instruction: MOV PSW, #07DH what is the active register bank? I believe its bank 2.
http://www.8052.com/users/dhenry/binconst.h
For your amusement this was a solution for 8 bit values I came up with a while ago: #define BIN(x) ((unsigned char)(((1##x##UL%2UL) | (((1##x##UL/10UL)%2UL)<<1) | (((1##x##UL/100UL)%2UL)<<2) | (((1##x##UL/1000UL)%2UL)<<3) | (((1##x##UL/10000UL)%2UL)<<4) | (((1##x##UL/100000UL)%2UL)<<5) | (((1##x##UL/1000000UL)%2UL)<<6) | (((1##x##UL/10000000UL)%2UL)<<7)))) Which allows things like: unsigned char x=BIN(01010101);
"For your amusement this was a solution for 8 bit values I came up with a while ago: #define BIN(x) ..." Which could also be at the core of 16-bit and 32-bit macros.