It is not permitted for the asm to write to any input register or memory location (unless that input is tied to an output). This is because the compiler will assume that you haven't mutated the input. And can therefore reuse the register with its value.
Additionally, you must add the option volatile. Otherwise the compiler is free to remove the piece of inline asm since you do not care about the output value!
It is not permitted for the asm to write to any input register or memory location (unless that input is tied to an output). This is because the compiler will assume that you haven't mutated the input. And can therefore reuse the register with its value.
Additionally, you must add the option volatile. Otherwise the compiler is free to remove the piece of inline asm since you do not care about the output value!
Here is an example that I believe to be correct:
links: https://github.com/avr-rust/delay/blob/7925367d8320ac970fbd9a62de72848860443049/src/lib.rs#L37 https://llvm.org/docs/LangRef.html#input-constraints