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 CCS Technical Support

Compiler's location of scratch variables

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







Compiler's location of scratch variables
PostPosted: Thu Nov 14, 2002 11:58 am     Reply with quote

<font face="Courier New" size=-1>Hi all!

Does anyone know if it is possible to control the compiler's reuse and location of scratch variables. I'm writing a RTOS for the 18 series, and my main problem right now is the compiler's reuse of memory locations in different processes and functions. I'm using pch v3.114.

-Ivar</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 8923
Darren Rook



Joined: 06 Sep 2003
Posts: 287
Location: Milwaukee, WI

View user's profile Send private message Send e-mail

Re: Compiler's location of scratch variables
PostPosted: Thu Nov 14, 2002 1:07 pm     Reply with quote

:=Does anyone know if it is possible to control the compiler's reuse and location of scratch variables. I'm writing a RTOS for the 18 series, and my main problem right now is the compiler's reuse of memory locations in different processes and functions. I'm using pch v3.114.

If you own PCWH, you can use CHIPEDIT.EXE to edit the device database. One of the fields is the location of the scratch registers.
___________________________
This message was ported from CCS's old forum
Original Post ID: 8933
_________________
I came, I saw, I compiled.
Ivar Johnsrud
Guest







Re: Compiler's location of scratch variables
PostPosted: Thu Nov 14, 2002 1:48 pm     Reply with quote

<font face="Courier New" size=-1>:=Does anyone know if it is possible to control the compiler's reuse and location of scratch variables. I'm writing a RTOS for the 18 series, and my main problem right now is the compiler's reuse of memory locations in different processes and functions. I'm using pch v3.114.

:=If you own PCWH, you can use CHIPEDIT.EXE to edit the device database. One of the fields is the location of the scratch registers.

Hum, I see. But it is only possible to edit the start address of scratch. I need to be able to locate every single scratch variable. All i need is a directive or something that says
#locate scratch=separate, that is, do no reuse memory locations for scratch variables.

-Ivar</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 8937
Tomi
Guest







Re: Compiler's location of scratch variables
PostPosted: Fri Nov 15, 2002 2:10 am     Reply with quote

But the size of the scratch RAM could be various on different cases. For example, if you use STANDARD_IO then CCS C allocates bytes in scratch area to keep a copy for all TRIS registers. If you use FIXED_IO or FAST_IO then it is not necessary. And if you use floating point arithmetics then you have at least a "float accumulator". Other example: if you have a function e.g. "void DoSomething(void)" then input parameter passing is not necessary. On the other hand if you have e.g. "int32 DoSomething(char in1, float in2, struct tm time, ....) then CCS C allocates scratch RAM for all input and output parameters.

:=<font face="Courier New" size=-1>:=Does anyone know if it is possible to control the compiler's reuse and location of scratch variables. I'm writing a RTOS for the 18 series, and my main problem right now is the compiler's reuse of memory locations in different processes and functions. I'm using pch v3.114.
:=
:=:=If you own PCWH, you can use CHIPEDIT.EXE to edit the device database. One of the fields is the location of the scratch registers.
:=
:=Hum, I see. But it is only possible to edit the start address of scratch. I need to be able to locate every single scratch variable. All i need is a directive or something that says
:=#locate scratch=separate, that is, do no reuse memory locations for scratch variables.
:=
:=-Ivar</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 8953
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