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.
"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?
ORG 0000H LJMP START
ORG 0030h START: MOV P3,#00H
In this piece of code,while debugging after reset ,it jumps to address 0030h I want to implement same thing in while i am doing the project havin C source file.
"I want to implement same thing in while i am doing the project havin C source"
Again, why do you want to do such a thing in a 'C' project?!
You had to do it in assembler, because that's the way assembler works - but there is no need to do it in 'C'!!
In fact, you should not do it in 'C' unless you have a very specific need to do so.