gnupic: Thread: Adding PIC support to SDCC


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Adding PIC support to SDCC
From: Scott Dattalo ####@####.####
Date: 1 Sep 2000 12:34:48 -0000
Message-Id: <Pine.LNX.4.21.0009010627570.29528-100000@tempest2.blackhat.net>

To SDCC list (gnupic list is cc'd)

I did a search through the archives and saw that this hasn't been discussed. I
also have briefly read the HTML docs and am led to believe that SDCC has been
designed in such a way that adding support for the PIC is theoretically
possible.

But before I proceed, let me introduce myself. I currently:
 -- maintain the GNUPIC web pages:
      http://www.gnupic.org/
 -- co-author of gpasm, the gnupic assembler
      http://www.dattalo.com/gnupic/gpasm.html
 -- co-author of gpsim, the gnupic simulator
      http://www.dattalo.com/gnupic/gpsim.html

In short, I'm open-sourced PIC enthusiast.

The question about open-sourced C compilers for the PIC arises frequently.
AFAIK, there aren't any (there is one that generates really, really horrible
code). Daniel Webb has started AnyC (http://www.crosswinds.net/~anyc/), a
project similar to SDCC except that the initial target is a PIC instead of an
8051. Unfortunately, his work has been very sporadic. Plus from I can tell there
are not as many optimization steps as there are in SDCC.  It appears that SDCC
would be the best platform to begin building a C compiler for the PIC.

Question 1:
I think I know the answer, but why was SDCC created separate from gcc? My guess
is that even though gcc can be retargeted, it makes certain underlying
assumptions which are invalid for microcontrollers.

Question 2:
Is SDCC `really' retargetable to a PIC? The underlying architecture of PICs is
entirely different than the 8051's. The major difference about which I'm
concerned is the way the two handle stacks. The PIC (midrange family) has a hard
ware code stack that is 8 levels deep. There is no way for this stack to be
accessed. Furthermore, there is no data stack. So consequently, there sre no
push/pop instructions. Does the intermediate code generator make assumptions
about the stack architecture? 

Question 3:
Have there been any queries/requests of porting SDCC to the PIC before?

Question 4:
Would anyone be interested in pursuing this effort?

Scott


[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.