Specifications
CAVR-4
240
Descriptions of intrinsic functions
AVR® IAR C/C++ Compiler
Reference Guide
__multiply_unsigned unsigned int __multiply_unsigned(unsigned char, unsigned char);
Generates a MUL instruction.
__no_operation void __no_operation(void);
Generates a NOP instruction.
__require void __require(void *);
Sets a constant literal as required.
One of the prominent features of the IAR XLINK Linker is its ability to strip away
anything that is not needed. This is a very good feature because it reduces the resulting
code size to a minimum. However, in some situations you may want to be able to
explicitly include a piece of code or a variable even though it is not directly used.
The argument to
__require could be a variable, a function name, or an exported
assembler label. It must, however, be a constant literal. The label referred to will be
treated as if it would be used at the location of the
__require call.
Example
In the following example, the copyright message will be included in the generated
binary file even though it is not directly used.
#include <intrinsics.h>
char copyright[] = "Copyright 2005 by XXXX";
void main(void)
{
__require(copyright);
[... the rest of the program ...]
}
__restore_interrupt
void __restore_interrupt(unsigned char oldState);
This intrinsic function will restore the interrupt flag to the specified state.
Note: The value of
oldState must be the result of a call to the __save_interrupt
intrinsic function.
__reverse unsigned int __reverse(unsigned int);
This intrinsic function reverses the byte order of the value given as parameter. Avoid
using
__reverse in complex expressions as it might introduce extra register copying.