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.
In assembler, you can write constants in binary. (Aside: for this very reason, it's a real pain that 'C' doesn't provide a binary notation for constants!) I'm using "modified binary" for C an example (SILabs f12x:
the .h looks like for SCON sfr S0_SCON0 = 0x98; // UART 0 CONTROL sbit SB0_SCON0_SM0 = 0x9F; sbit SB0_SCON0_SM1 = 0x9E; sbit SB0_SCON0_SM2 = 0x9D; sbit SB0_SCON0_REN = 0x9C; sbit SB0_SCON0_TB8 = 0x9B; sbit SB0_SCON0_RB8 = 0x9A; sbit SB0_SCON0_TI = 0x99; sbit SB0_SCON0_RI = 0x98; #define SM_SCON0_SM0 0x80 #define SM_SCON0_SM1 0x40 #define SM_SCON0_SM2 0x20 #define SM_SCON0_REN 0x10 #define SM_SCON0_TB8 0x08 #define SM_SCON0_RB8 0x04 #define SM_SCON0_TI 0x02 #define SM_SCON0_RI 0x01 The initialization then looks like S0_SCON0 = 0 + SM_SCON0_SM0 + SM_SCON0_SM1 + SM_SCON0_REN; and is crystal clear Erik PS the added characters have purposes irrelevant to the "pseudo binary"