__sfr32 causes instruction destication register to be wrong for the MSB.
Assembly output of main.c compile sdcc -mmcs51 main.c.
000000 E4 [12] 192 clr a
193 000001 F5 A7 [12] 193 mov ((_SFR_DATA_U32 >> 0) & 0xFF),a
194 000003 F5 A6 [12] 194 mov ((_SFR_DATA_U32 >> 8) & 0xFF),a
195 000005 F5 A5 [12] 195 mov ((_SFR_DATA_U32 >> 16) & 0xFF),a
196 000007 F5 FF [12] 196 mov ((_SFR_DATA_U32 >> 24) & 0xFF),a
197 197 ; ../../main.c:6: while(1);
mov ((_SFR_DATA_U32 >> 24) & 0xFF),a generate F5 FF but is should generate F5 A4.
Seen on
I see that the main.c has changed
A4intoA3but still the same issue. It keeps generatingF5 FF.I also see it in reverse
mov a, (SFR_DATA_U32),E5 FF.FFlocation shouldA4and in the
lst-file it get this notation