View previous topic :: View next topic |
Author |
Message |
Delfy_Coltech
Joined: 25 Nov 2009 Posts: 27 Location: Vietnam
|
[Help] Fix GOTO address value? |
Posted: Sat Mar 26, 2011 6:11 am |
|
|
Hi all,
I am newbie in using CCS C Compiler.
I see that, the first value in HEX file when I compile by CCS is the GOTO value (Ex: 040500). It mean that when running, Program will move into 0x500 address. (Start address of main program)
If I change the code in my main application. The GOTO address will be changed too.
So, how can I fix the GOTO address with no-change value when adding code to main.????(ex: 0x500)
Thanks, _________________ -------------------------------------------------
Mechatronics Department, Coltech, VNUH
Hanoi, Vietnam.
------------------------------------------------- |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sat Mar 26, 2011 12:03 pm |
|
|
The initial goto can be set with a #build reset= statement in CCS C. Consult the compiler manual for details.
It would be easier to help, if you tell, what you want to achieve. |
|
|
Delfy_Coltech
Joined: 25 Nov 2009 Posts: 27 Location: Vietnam
|
|
Posted: Sat Mar 26, 2011 11:17 pm |
|
|
Thanks for your suggestion, Mr FvM.
I am going to try this way now. And report later.
My problem is that. Find the CCS command to fix GOTO address value when changing my code.
It means that: I want my GOTO address value is always 0x500.
Can U share anything? _________________ -------------------------------------------------
Mechatronics Department, Coltech, VNUH
Hanoi, Vietnam.
------------------------------------------------- |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Delfy_Coltech
Joined: 25 Nov 2009 Posts: 27 Location: Vietnam
|
|
Posted: Sun Mar 27, 2011 8:13 pm |
|
|
Thank you very much!
I have fixed my error by using a simple #ORG command before main function.
Code: |
#ORG 0x500, 0x1000
void main
{
...
}
|
An important thing is that we have to check the mount of main function in order to choose right value address in #ORG command. _________________ -------------------------------------------------
Mechatronics Department, Coltech, VNUH
Hanoi, Vietnam.
------------------------------------------------- |
|
|
|