This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

.LST and .M51 SFR mapping mismatches (uvision2 6.02 and 6.10)

Hi,

In an older version of my software, I use a specific SFR (CNTRL_REG) mapped on 0xC5 SFr address.
In the new version, I need to map it at 0xC1.
I thought it was very easy just by changing the definition line from

sfr CNTRL_REG = 0xC5
to
sfr CNTRL_REG = 0xC1

After compiling the newer version, we still get CNTRL_REG mapped to 0xC5 in the simulator disassembler. In the .m51 file, CNTRL_REG is also mapped to 0xC5, whereas .LST and .SRC files mapped it to 0xC1 as requested.

Anybody has an idea ?

Thanks for your help.

Arnaud DELEULE

Parents
  • Aha!

    The #pragma src directs the compiler to generate a .src assembly source file as its output; you must then pass the .src file to the Assembler to generate a .obj Object file.

    In uVision2, check the 'Assemble SRC File' option.

    If you use #pragma src, the compiler does not generate a .obj object file!
    If you have an old .obj file kicking around, the linker will still link it but it won't reflect the changes to your 'C' source!

    See the C51 Manual and the uVision2 "Getting Started" guide.

Reply
  • Aha!

    The #pragma src directs the compiler to generate a .src assembly source file as its output; you must then pass the .src file to the Assembler to generate a .obj Object file.

    In uVision2, check the 'Assemble SRC File' option.

    If you use #pragma src, the compiler does not generate a .obj object file!
    If you have an old .obj file kicking around, the linker will still link it but it won't reflect the changes to your 'C' source!

    See the C51 Manual and the uVision2 "Getting Started" guide.

Children