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

Automatic generation of an assembly file with symbols declaration starting from file .m51

I would like to know if there's some utility application to automatically
generate an .a51 file carrying the whole information about symbols
contained into the linker listing file .m51.
Thanx.
Regards.

Parents Reply Children
  • I guess what he faces is a situation much like one we have around here.

    Code in our project is split up in two parts: a default version of the whole project sitting in ROM, and a reduced copy of it sitting in flash memory. Both are generated from the same sources, but large parts of the code are #ifdef'ed out for the flash build. The idea is that for functions that haven't changed since the ROM was built, the flash should just call the ROM code, to reduce flash memory usage.

    The trick is to extract the addresses of all those ROM routines called by the flash out of the ROM build's map file and translate them into a special "import library" kind of header file like this:

    symbol1    set   01234h
    symbol2    set   02345h
    

    A C program to generate this from the map file is not particularly hard to write --- but may need attention from time to time, as Keil modifies the map file syntax ever so slightly.

  • Extracting the symbols from the OMF or OBJs would avoid the problem of changing file formats. A bit more difficult to write the program, of course.

  • "A bit more difficult to write the program, of course"

    Possbily not - OMF is designed to be machine-readable; the linker listing isn't!