port gcc for c51 step by step

... snip ...

Please do not top-post, and please do snip material that is not germane to your answer. See especially the last three links in my sig. below.

--
 Some informative links:
   news:news.announce.newusers
   http://www.geocities.com/nnqweb/
   http://www.catb.org/~esr/faqs/smart-questions.html
   http://www.caliburn.nl/topposting.html
   http://www.netmeister.org/news/learn2quote.html
Reply to
CBFalconer
Loading thread data ...

... snip ...

I suggest the OP would be better off starting from a recursive descent compiler, such as SmallC. He can maintain the C parsing unchanged, and only alter the code generation area. To do that he will have to understand the destination architecture intimately, and build whatever run time assistance and standard library components are needed.

--
 Some informative links:
   news:news.announce.newusers
   http://www.geocities.com/nnqweb/
   http://www.catb.org/~esr/faqs/smart-questions.html
   http://www.caliburn.nl/topposting.html
   http://www.netmeister.org/news/learn2quote.html
Reply to
CBFalconer

Most 8051 C compilers do not implement a stack in software but instead rely on passing parameters via registers and avoid stack manipulation altogether. Most also include profilers that help optimise register usage. AFAIK gcc is unable to work this way without changes to its core functionality. You *could* use a software stack but it is incredibly inefficient on an 8051.

Anything is possible and you could create a unique fork of gcc that supported the 8051 in the same way that there are special ports of other micros not supported by the gcc core team. However, I do not think the 8051 will ever be supported by the gcc core.

Ian

Reply to
Ian Bell

IIRC, the one I'm remembering (Archimedes?) would do things either way. It would use registers or static locations by default, but if you told it you wanted re-entrant code, it would do a software stack.

It's been done, and I know projects where it was used successfully.

Yup. I use one of them every day.

I don't think so either. It would be too much work for what I think would be pretty lousy results.

--
Grant Edwards                   grante             Yow!  I am having a
                                  at               CONCEPTION--
                               visi.com
Reply to
Grant Edwards

I don't recall that one - is it still available? Common ones available now are Keil, Renaissance and Tasking, all of which I believe operate as I described. A software stack is of course feasible but very messy and slow on an 8051.

Ian

Reply to
Ian Bell

Hmm. It's looking doubtful. That was probably 10+ years ago. I found a link at

formatting link
but there's nothing there.

We also had the Franklin compiler, so I might be mixing them up. Their web site looks a bit out-of-date as well:

# State-of-the-art integrated Windows 3.1, WIN95, and Windows NT compliant software tools

How do they generate re-entrant code if they don't implement a stack in softwate?

--
Grant Edwards                   grante             Yow!  Nice decor!
                                  at               
                               visi.com
Reply to
Grant Edwards

lcc is simple (while being full ANSI C) and strictly divided into architecture independent and dependent parts (and reasonably well documented, including the book*); it is designed for easy retargetability. Other compilers may have particular advantages for tiny architectures though. Things get tricky with lcc on architectures < 32 bits (and few registers).

  • formatting link
Reply to
toby

They have a special directive to declare a function reentrant, which then builds a software stack for that function e.g. Keil uses:

void myfunc(void) reentrant { ... }

Ian

Reply to
Ian Bell

You may find it in the IAR product line. Archimedes used to resell IAR compilers under its own name.

Reply to
Roberto Waltman

Wasn't Renaissance sold as Archimedes in the USA at one time ?

Regards Anton Erasmus

Reply to
Anton Erasmus

Dunno. That was probably almost 15 years ago.

--
Grant Edwards                   grante             Yow!  Were these parsnips
                                  at               CORRECTLY MARINATED in
                               visi.com            TACO SAUCE?
Reply to
Grant Edwards

It's *very* easy to use with gcc -- the official Microchip tool chain for the PIC30 is based on gcc.

-- Dave Tweed

Reply to
David Tweed

Thanks all for your time !!! This is over this subjekt. I have solve c51 & gcc problem.

100000000 times thank you!!!

Best regards Pawel_O

I'm sorry for my poor english... ;)

U¿ytkownik "Pawel_O" napisa³ w wiadomo¶ci news:e6cq6j$8lk$ snipped-for-privacy@portraits.wsisiz.edu.pl...

Reply to
Pawel_O

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.