5 IAR Intrinsic Functions
This section shows a summary of IAR intrinsic functions and the best MPLAB XC8 replacement where that is available. These intrinsic functions and their MPLAB XC8 equivalents are discussed in more detail in the sections that follow. Note that what is referred to as an intrinsic function by IAR documentation is known as a built-in function in the MPLAB XC context. It is recommended that you compare the relevant sections in the MPLAB® XC8 C Compiler User's Guide for AVR MCUs with those in your IAR C/C++ Compiler User Guide to ensure that migrated code will work as expected in all situations.
IAR Intrinsic Function (links to explanatory section) | Suggested MPLAB XC8 Migration |
---|---|
__delay_cycles | Use the _delay_ms() or _delay_us()
functions |
__DES_decryption | No simple migration recommended |
__DES_encryption | No simple migration recommended |
__disable_interrupt | Use
di() macro. |
__enable_interrupt | Use the
ei() macro. |
__extended_load_program_memory | Use the address cast to a pointer and deferenced |
__fractional_multiply_signed | Use in-line assembly to insert the fmuls
instruction |
__fractional_multiply_signed_with_unsigned | Use in-line assembly to insert the fmulsu
instruction |
__fractional_multiply_unsigned | Use in-line assembly to insert the fmul
instruction |
__get_interrupt_state | Use in-line assembly to directly fetch the state of the register |
__indirect_jump_to | Use in-line assembly to insert the ijmp or
eijmp instruction |
__insert_opcode | Use in-line assembly to insert a .word directive |
__lac | Use in-line assembly to insert the lac instruction |
__las | Use in-line assembly to insert the las instruction |
__lat | Use in-line assembly to insert the lat instruction |
__load_program_memory | The address cast and dereferenced in C code |
__multiply_signed | Use in-line assembly to insert the muls instruction |
__multiply_signed_with_unsigned | Use in-line assembly to insert the mulsu instruction |
__multiply_unsigned | Use in-line assembly to insert the mul instruction |
__no_operation | Use the _NOP()
macro. |
__require | No simple migration recommended |
__restore_interrupt | Use plain C code to write the SREG register |
__reverse | No simple migration recommended |
__save_interrupt | Plain C code to copy the SREG register |
__set_interrupt_state | Use in-line assembly to directly set the state of the register |
__sleep | Use in-line assembly to insert the sleep
instruction |
__swap_nibbles | No simple migration recommended |
__watchdog_reset | Use in-line assembly to insert the wdr
instruction |
__xch | Use in-line assembly to insert the xch instruction |