KickC Optimizing C-Compiler now supports Commander X16
Posted: Mon Jan 18, 2021 7:58 am
38 minutes ago, kktos said:
Tom, I guess that's related to what Jesper told you already about the compiler no "seeing" the var in the asm.
Therefore, here, as it doesn't see any use of R0, it simply removes it.
You need to use volatile in the declaration so the complier won't optimize it
Yeah, I tried that... still no joy. The error I get is "unknown addressing mode". The compiler doesn't understand that STA (R0),Y should be an indirect , Y indexed instruction with the address of R0.
The compiler does generate code for STA R0, which generates STA $02, but not for STA ($02),Y