Hello,
I and a friend are [play,work]ing on a little RTOS. I try to compile it
with SDCC for PIC18...and it seems some work is needed on the SDCC
side. Is there a document (TODO, roadmap...) about what is ok and what
still need hands? Maybe the sdcc-devel list is a better place for
discussing this?
I attached a little patch which correct stack access in case of stack
model large. I think it should have been better to correct that when
writing the offset instead of when reading it but I've found (maybe I'm
wrong...) this is done in the general SDCC part, which frightened me
a bit. Anyway, the following patch works, which is not so bad :)
In the hope this will help, and in the hope I'll have skills to help
more.
Regards,
Vincent
*** ../sdcc-5000/src/pic16/gen.c 2008-01-28 21:49:05.000000000 +0100
--- src/pic16/gen.c 2008-01-29 21:50:39.000000000 +0100
***************
*** 741,746 ****
--- 741,749 ----
// local variables (index == 0 is not assigned so we add one here)
{
int soffs = sym->stack;
+ /* if stack model is large, offset needs increment */
+ if(pic16_options.stack_model==1)
+ soffs++;
if (soffs <= 0) {
assert (soffs < 0);
soffs++;
***************
*** 1412,1417 ****
--- 1415,1423 ----
// starting at 2 for arguments and growing from 0 downwards for
// local variables (index == 0 is not assigned so we add one here)
int soffs = OP_SYMBOL(IC_RESULT(ic))->stack;
+ /* if stack model is large, offset needs increment */
+ if(pic16_options.stack_model==1)
+ soffs++;
if (soffs <= 0) {
assert (soffs < 0);
soffs++;
***************
*** 12591,12596 ****
--- 12597,12605 ----
{
int soffs = OP_SYMBOL( IC_LEFT(ic))->stack;
+ /* if stack model is large, offset needs increment */
+ if(pic16_options.stack_model==1)
+ soffs++;
if (soffs <= 0) {
assert (soffs < 0);
soffs++;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user