Synopsis
void __set_register(unsigned reg,
                    unsigned value);
Description

__set_register sets CPU register reg to value. reg must be a compile-time constant, and value can be any expression. Note that the compiler emits a MOVW instruction to move value to reg and does not save reg in the function entry nor restore it on function exit, so you must ensure that you respect the calling conventions of the compiler. Also, using reg does not reserve reg from the compiler register allocator, so you must be careful not to overwrite a local. __set_register should be used for writing small wrapper routines in C that can be hand checked for correctness.

__set_register returns value.

__set_register is an intrinsic function and produces inline code.