Technical Support

MON51: STARTING PROGRAMS AT ADDRESSES OTHER THAN 0000H


Information in this article applies to:

  • C51 All Versions
  • µVision Version 2 and Later

QUESTION

I'm using the monitor and µVision to download and test my program. The monitor is configured to load programs starting at address 0x4000. Is there anything special I must do to start running these programs in µVision?

ANSWER

Yes. First, you must create a debugger .INI file that sets the program starting address and runs to the beginning of the main C function. Then, you must change the debugger settings to use this new .INI file.

  1. In µVision, create a new file (named DEBUG.INI) and add the following to it:
    $ = 0x4000
    g,main
    

    These lines tell the debugger to set the program counter to 0x4000 (the starting address of your program) and to run until reaching the main C function.

  2. In µVision, open the Debug Tab from the Project Options Dialog.
  3. Make sure that Load Application at Startup is selected (checked).
  4. Make sure that Go Till Main is not selected (unchecked).
  5. Enter DEBUG.INI for the name of the Initialization File.

When you start the debugger, it will load the application and then execute the initialization file (DEBUG.INI) which will set the program start address to 0x4000 and run to the main C function.

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Saturday, July 09, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure