|
|
View previous topic :: View next topic |
Author |
Message |
Ivar Johnsrud Guest
|
Compiler's location of scratch variables |
Posted: Thu Nov 14, 2002 11:58 am |
|
|
<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
|
Re: Compiler's location of scratch variables |
Posted: Thu Nov 14, 2002 1:07 pm |
|
|
:=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 |
Posted: Thu Nov 14, 2002 1:48 pm |
|
|
<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 |
Posted: Fri Nov 15, 2002 2:10 am |
|
|
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 |
|
|
|
|
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
|