i need to change the starting location of my pgm frm 00h to say,400h..i followed the steps as per mentioned in.... http://www.keil.com/support/docs/189.htm i can see the changed starting location in the memory map file...but when i try to implemnt it on hardware,i get no output probably bcos da execution begins at 00h only...pls help...
Moving the code to 0x400 doesn't help if you don't have a boot loader that picks up where the processor actually starts, and that jumps to 0x400.
Next thing is that if the processor has the interrupt vectors in low memory, then you must fix some proxy code that takes care of them and calls your code above 0x400.
So the really big question is: Why do you _need_ to move the start location to 0x400?
Why "probably"?
What tests/investigations/debugging have you done to make certain whether that is or is not the cause?
Only you have your code - nobody else can debug it for you!
i've changed the boot vector address to 04(high byte) through Flash Magic and set the status bit..its a simple pgm for a LED to blink...
'probably' cos i'm not sure...i dont see any other possibility...the program hs been loaded at 0x400 from what i've checkd..the issue being there is no execution happenin...
Remember the 8051 hardware will always start execution at CODE address zero. This is hard-wired into the physical construction of the chip - there is nothing you can do to change this!
Therefore, as Per says, you must have something at CODE address zero that will cause the CPU to jump to the start of your code.
Have you done that?
See my previous post - how do you expect the processor to find that program at that location...?
wel i thot since main() has changed to a new location,execution of the pgm wud also henceforth begin at the new location...nw wat do i do so that the processor will jump to a the start of my code?
"wel i thot since main() has changed to a new location"
Slow down. Again: Why do you need to move main?
Again, how did you think that the processor - ie, the silicon chip - would know that?
Remember, you are writing for simple embedded microcontroller - you don't have an operating system to do this stuff for you!
8051 Basics: www.8052.com/.../120112 http://www.8052.com/tutorial
Books: http://www.keil.com/books/
"nw wat do i do so that the processor will jump to a the start of my code?"
Please try to take care to write complete words.
If you need to ask that question, then why are you messing about with changing the start address of your code anyhow??
Exactly:
why are you messing about with changing the start address of your code anyhow??
i'm trying to write a bootloader code...i've got some other application that starts from 00h...at power on,if i press 'space bar' thrice,i need the processor to jump to another location,ie 400h
Sounds like you need to do some basic study on bootloaders, then!
If you're trying to write a bootloader, you should understand that it's the bootloader that runs from the hardware reset vector, and it's the bootloader that manages the jump to the application - yes?
nop..this is like a software upgrade...during the power on,the normal application starts running at hardware reset vector,ie,00h...if i press the 'space bar' thrice,i need the code at boot vector address to execute...the boot vector address has the code for a software upgrade....
Wrong!
At power up, you need the Bootloader to start. It is the bootloader which decides whether to run the "normal" application or, on the 3 spaces, go into "software update" mode...