5.12 __insert_opcode Intrinsic Function
The IAR __insert_opcode
intrinsic function inserts a DW
unsigned
directive.
Suggested Replacement
There is no MPLAB XC equivalent built-in function; however, instructions can be inserted explicitly using in-line assembly code.
Use in-line assembly to directly write a .word
directive.
Caveats
None
Examples
Consider migrating IAR code such as:
char x, y;
int z;
void foo(void) {
z = __insert_opcode(0x80a8);
}
to MPLAB XC8 code similar to:#include <xc.h>
char x, y;
int z;
void foo(void) {
z = asm(".word 0x80a8");
}
Further Information
See the In-line Assembly section in the MPLAB XC8 C Compiler User's Guide for AVR MCUs for more information on adding in-line assembly.