This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Need Help

If I execute an instruction: MOV PSW, #07DH what is the active register bank? I believe its bank 2.

Parents
  • 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);

Reply
  • 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);

Children