Following output in the asm File:
; ledtest.c:85: RFPWR &= ~RREG_RADIO_PD;
; ledtest.c:86: while((RFPWR & ADI_RADIO_PD) == 1);
Where RFPWR is:
xdata at 0xDF17 uint8_t RFPWR;
#define RREG_RADIO_PD 0x08
#define ADI_RADIO_PD 0x16
So my question is why the "mov r2,a" is generated in the first section, although r2 isn't used there at all and doesn't have to do with the use of r2 in the next section?
If you recompile the source with --fverbose-asm you can see the peephole rules that were applied to get to this asm. If you then recompile also with --no-peep you can see the original asm. You'll find out that writing to r2 is a left-over after the peephole optimization but it is difficult to determine for sure that it can be left out.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.