What registers are available for inline assembly?


The DIOB, A, P in all of its forms (p31_0, p31_16, and so on) are all available for inline assembly essentially without any issues.

The B register is used as a temporary location in expression processing. It is usually freed by the end of a C statement, allowing inline assembly.

The MACH and MACL are sometimes used by the compiler in C functions that don't involve multiply and divide operations as storage for local variables. Register usage in inline assembly is NOT tracked by the compiler; diagnose any conflicts through the listing file.

The C, D and SR are used for local variables in ETPU_function threads. Any of these registers may be declared as global variables in an application; if so declared, the compiler will not use registers for local variables.