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

RESET Address

I am using Atmels At89S52 Microcontroller for my project. I am using C language.
Kindly anybody tell me where to specify the starting address of the code.I have tried to modify Startup.A51 file.But not working.I wanted to start my code at 0030H.After power up the MCU starts at 0000h.How to give the LJMP to 0030h in C source.
Kindly reply me on this as early as possinble.

Parents
  • "I have tried to modify Startup.A51"

    So what did you do?

    "But not working"

    That tells us virtually nothing!
    In what way is it "not working"?
    What did it do?
    How did you test it?
    What debugging did you do?

    "I wanted to start my code at 0030H"

    Any particular reason?
    Note that this address is within the interrupt vector table!

    "After power up the MCU starts at 0000h"

    Of course it does - that is the way the hardware works.
    There is no way you can change that in software - not in 'C'; not in assembler.

    "How to give the LJMP to 0030h in C source."

    You can't - 'C' doesn't do that kind of thing.

    You could look at using Linker controls to position your code - as this is the job of the Linker, not the compiler.

    But, again, why do you want to do this?

Reply
  • "I have tried to modify Startup.A51"

    So what did you do?

    "But not working"

    That tells us virtually nothing!
    In what way is it "not working"?
    What did it do?
    How did you test it?
    What debugging did you do?

    "I wanted to start my code at 0030H"

    Any particular reason?
    Note that this address is within the interrupt vector table!

    "After power up the MCU starts at 0000h"

    Of course it does - that is the way the hardware works.
    There is no way you can change that in software - not in 'C'; not in assembler.

    "How to give the LJMP to 0030h in C source."

    You can't - 'C' doesn't do that kind of thing.

    You could look at using Linker controls to position your code - as this is the job of the Linker, not the compiler.

    But, again, why do you want to do this?

Children