CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

[Help] Fix GOTO address value?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Delfy_Coltech



Joined: 25 Nov 2009
Posts: 27
Location: Vietnam

View user's profile Send private message Visit poster's website

[Help] Fix GOTO address value?
PostPosted: Sat Mar 26, 2011 6:11 am     Reply with quote

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. Shocked

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

View user's profile Send private message

PostPosted: Sat Mar 26, 2011 12:03 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Sat Mar 26, 2011 11:17 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Mar 27, 2011 12:35 am     Reply with quote

Use the #org directive to set the start and end address of the main() function.
See the CCS manual.
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
Delfy_Coltech



Joined: 25 Nov 2009
Posts: 27
Location: Vietnam

View user's profile Send private message Visit poster's website

PostPosted: Sun Mar 27, 2011 8:13 pm     Reply with quote

Quote:
Use the #org directive to set the start and end address of the main() function.
See the CCS manual.
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf


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.
-------------------------------------------------
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group