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

LIB_CODE in *.m51 files

Hello,

I have a problem with extracting data from *.m51 to build simulator. There are some library code in *.m51, placed in segments:
LIB_CODE and LDIV.
I guess it's length and address depends on which KEIL *.lib files are used.
Do you have any idea what should I do when simulator comes to lib part? Is there a possibility to enter in library code and debug? I don't have a source of KEL lib files, and don't know their order in LIB_CODE segment..

Best regards,
Branislava

Parents Reply Children
  • <i.have to build debugger for 8051
    If you are talking about "live" debugging (as with an ICE) good luck, you will need it. If you are talking about simulating WHY?, keil has one, Juergen Wickenhauser has one, Vault has one, and more. Why reinvent the wheel?.


    Erik

  • "I'm talking about 8051 core within FGPA design"

    that shouldn't be a problem - the behaviour of the 8051 core should be unaffected.

    Therefore, you can use the standard Keil compiler which simulates a standard 8051 "core" - you can add your "special" features via the Advanced Generic Simulator Interface (AGSI).

    See Application Note 154, Implementing DLLs for User-defined Simulation (AGSI)
    http://www.keil.com/appnotes/docs/apnt_154.asp

    "...and have to build debugger for 8051."

    Again, no you don't. The behaviour of the 8051 "core" is (or should be!) standard - so you just use the standard debugger, via the Advanced Generic Debugger Interface (AGDI).
    See Application Note 145, Implementing DLLs for Hardware Debuggers (AGDI) Rev. 3
    http://www.keil.com/appnotes/docs/apnt_145.asp

    If you really must roll your own debugger, why not take a look as SDCC?
    It's open-source, and includes a debugger:
    http://sdcc.sourceforge.net/
    I think there's also a simulator.

    But, whatever you do, the .OBJ file is the place to look for your debug information - not the listings!

  • thank you.. but our business companions supply simulator (without the source code, which simulates all FPGA design) and ordered from us debugger for 8051 core, which should take information from *.lst and *.m51 files. Now we are having problems with that, especially when LIB code appears. Do you know where I can find KEIL *.lst file description ? (for exaple - LIB code parts are marked with 'E'..)

    Brana

  • ordered from us debugger for 8051 core, which should take information from *.lst and *.m51 files. Now we are having problems with that
    If you can not eductate your customer re the .omf/.bas files which (s)he can not avoid making (they DO have them) then it will cost you more to fulfil the contract than you can possibly make from it.

    Erik