SLAU132Y September 2004 – June 2021
Table 7-5 lists all of the intrinsic operators in the MSP430 C/C++ compiler. A function-like prototype is presented for each intrinsic that shows the expected type for each parameter. If the argument type does not match the parameter, type conversions are performed on the argument. The intrinsics.h file in the compiler's "include" directory contains function-like prototypes for all supported intrinsics.
For more information on the resulting assembly language mnemonics, see the MSP430x1xx Family User’s Guide, the MSP430x3xx Family User’s Guide, and the MSP430x4xx Family User’s Guide.
Intrinsic | Generated Assembly | |
---|---|---|
unsigned short | __bcd_add_short(unsigned short op1, unsigned short op2); | MOV op1, dst
CLRC DADD op2, dst |
unsigned long | __bcd_add_long(unsigned long op1, unsigned long op2); | MOV op1_low, dst_low
MOV op1_hi, dst_hi CLRC DADD op2_low, dst_low DADD op2_hi, dst_hi |
unsigned short | __bic_SR_register(unsigned short mask); | BIC mask, SR |
unsigned short | __bic_SR_register_on_exit(unsigned short mask); | BIC mask, saved_SR |
unsigned short | __bis_SR_register(unsigned short mask); | BIS mask, SR |
unsigned short | __bis_SR_register_on_exit(unsigned short mask); | BIS mask, saved_SR |
unsigned long | __data16_read_addr(unsigned short addr); | MOV.W addr, Rx MOVA 0(Rx), dst |
void | __data16_write_addr (unsigned short addr, unsigned long src); | MOV.W addr, Rx MOVA src, 0(Rx) |
unsigned char | __data20_read_char(unsigned long addr);(1) | MOVA addr, Rx MOVX.B 0(Rx), dst |
unsigned long | __data20_read_long(unsigned long addr);(1) | MOVA addr, Rx MOVX.W 0(Rx), dst.lo MOVX.W 2(Rx), dst.hi |
unsigned short | __data20_read_short(unsigned long addr);(1) | MOVA addr, Rx MOVX.W 0(Rx), dst |
void | __data20_write_char(unsigned long addr, unsigned char src);(1) | MOVA addr, Rx MOVX.B src, 0(Rx) |
void | __data20_write_long(unsigned long addr, unsigned long src);(1) | MOVA addr, Rx MOVX.W src.lo, 0(Rx) MOVX.W src.hi, 2(Rx) |
void | __data20_write_short(unsigned long addr, unsigned short src);(1) | MOVA addr, Rx MOVX.W src, 0(Rx) |
void | __delay_cycles(unsigned long); | See Section 7.9.4. |
void | __disable_interrupt(void); OR __disable_interrupts(void); |
DINT |
void | __enable_interrupt(void); OR __enable_interrupts(void); |
EINT |
unsigned int | __even_in_range(unsigned int, unsigned int); | See Section 6.12.32. |
uint32_t | __f32_bits_as_u32( float src ) | Extracts the bits in a float as a 32-bit register. See Section 7.9.2. |
uint64_t | __f64_bits_as_u64( double src ) | Extracts the bits in a double as a 64-bit register. See Section 7.9.2. |
unsigned short | __get_interrupt_state(void); | MOV SR, dst |
unsigned short | __get_R4_register(void); /* deprecated */ | MOV.W R4, dst |
unsigned short | __get_R5_register(void); /* deprecated */ | MOV.W R5, dst |
unsigned short | __get_SP_register(void); | MOV SP, dst |
unsigned short | __get_SR_register(void); | MOV SR, dst |
unsigned short | __get_SR_register_on_exit(void); | MOV saved_SR, dst |
void | __low_power_mode_0(void); | BIS.W #0x18, SR |
void | __low_power_mode_1(void); | BIS.W #0x58, SR |
void | __low_power_mode_2(void); | BIS.W #0x98, SR |
void | __low_power_mode_3(void); | BIS.W #0xD8, SR |
void | __low_power_mode_4(void); | BIS.W #0xF8, SR |
void | __low_power_mode_off_on_exit(void); | BIC.W #0xF0, saved_SR |
void | __never_executed(void); | See Section 7.9.5. |
void | __no_operation(void); | NOP |
void | __op_code(unsigned short); | Encodes whatever instruction corresponds to the argument. |
short | __saturated_add_signed_short( short src1, short src2 ); | Instructions to perform saturated addition on short values. Values outside the range of a signed short are capped at the maximum or minimum value as appropriate. |
long | __saturated_add_signed_long( long src1, long src2 ); | Instructions to perform saturated addition on long values. Values outside the range of a signed long are capped at the maximum or minimum value as appropriate. |
short | __saturated_sub_signed_short( short src1, short src2 ); | Instructions to perform saturated subtraction on short values. Values outside the range of a signed short are capped at the maximum or minimum value as appropriate. |
long | __saturated_sub_signed_long( long src1, long src2 ); | Instructions to perform saturated subtraction on long values. Values outside the range of a signed long are capped at the maximum or minimum value as appropriate. |
void | __set_interrupt_state(unsigned short src); | MOV src, SR |
void | __set_R4_register(unsigned short src); /* deprecated */ | MOV.W src, R4 |
void | __set_R5_register(unsigned short src); /* deprecated */ | MOV.W src, R5 |
void | __set_SP_register(unsigned short src); | MOV src, SP |
unsigned short | __swap_bytes(unsigned short src); | MOV src, dst
SWPB dst |
float | __u32_bits_as_f32(uint32_t src) | Packs a 32-bit register as a float. See Section 7.9.2. |
double | __u64_bits_as_f64(uint64_t src) | Packs a 64-bit register as a double. See Section 7.9.2. |