Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What registers are available for inline assembly?

assembly inline registers
0
Posted

What registers are available for inline assembly?

0

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.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123