Part Number: MSP430F5244
Hi, MSP430 Support team
I will ask you a question from "Related Questions".
Last time, Mr. Dennis gave me the opinion that if you want to write a value to SR, you need to write it with the BIS instruction.
I have a questions about that.
The table below is a screenshot from the compiler guide.

The above is stated that if I use __bis_SR_register() of intrinsic function, the compiler will be converted to BIS.
However, I checked it also converted BISX.
Is this a compiler bug?
If it is not a compiler bug, please tell me the conversion rules for BIS and BISX of the compiler.
The following is the source code and screenshot that is converted to BISX instructions.
#include <msp430.h>
#define set_LPM_Mode(x) __bis_SR_register(x)
static const unsigned short SET_LP_MODE[5]={GIE, LPM0_bits|GIE, LPM1_bits|GIE, LPM2_bits|GIE, LPM3_bits|GIE};
unsigned int count=4;
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
while(1)
{
set_LPM_Mode(SET_LP_MODE[count]); // Enter LPM3
__no_operation(); // For debugger
}
}
Best Regards,
Koki