Re: AVR IAR C Compiler

Due to this, the register values are being tampered, which were set

> by other functions.

Hold it right there. You're writing a C function. If it wants to take values from other functions, put them in the argument list, not in registers.

C is not assembler, so don't pretend otherwise. One of the differences is that you *have to* give up control over the CPU registers, and leave them to the C compiler to work with.

You're fighting the C compiler instead of using it. Don't.

Hans-Bernhard Broeker (
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker
Loading thread data ...

Big parameter list? Have you considered simply passing a pointer to a structure?


formatting link

Reply to
Steve at fivetrees

"Vidya" skrev i meddelandet news:

Why not push these registers in your function before use?

A. P. Richelieu
Reply to
A.P. Richelieu

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.