If I execute an instruction: MOV PSW, #07DH what is the active register bank? I believe its bank 2.
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.