EmbeddedRelated.com
Forums

80186 free C compiler

Started by John Wilkinson September 30, 2005
Hi,
I am new to all this but I am about to try my first embedded design using
an 80C186 processor.
Is there a free C compiler available?
Am I correct in thinking gcc can't target the 80186 processor?

I understand I need a locator as well?
Again is there a free one?

Where can I get startup code? The book I have is Programming Embedded
Systems by Michael Barr, and he says that you could use libgloss, but I
can't find it anywhere on the internet!!

Best regards,
John.
"John Wilkinson" <john.wilkinson@philips.com> wrote in message
news:ff0yg393dw7q$.x6somhk77uvk$.dlg@40tude.net...
> Hi, > I am new to all this but I am about to try my first embedded design using > an 80C186 processor. > Is there a free C compiler available? > Am I correct in thinking gcc can't target the 80186 processor? > > I understand I need a locator as well? > Again is there a free one? > > Where can I get startup code? The book I have is Programming Embedded > Systems by Michael Barr, and he says that you could use libgloss, but I > can't find it anywhere on the internet!! > > Best regards, > John.
http://www.openwatcom.org/ can target 186 and is free. It creates .exe's however that run on top of DOS and it sounds like you just have a bare board. However the compiler source code is available so if nothing else you might be able to get the startup code. There are free DOS versions around should that make it easier for you. Looking at your email address - Philips and x86? Regards, Richard. http://www.FreeRTOS.org
John Wilkinson wrote:
> Where can I get startup code? The book I have is Programming Embedded > Systems by Michael Barr, and he says that you could use libgloss, but I > can't find it anywhere on the internet!!
IIRC, libgloss is included with newlib. ftp://sources.redhat.com/pub/newlib/index.html -- Michael N. Moran (h) 770 516 7918 5009 Old Field Ct. (c) 678 521 5460 Kennesaw, GA, USA 30144 http://mnmoran.org "So often times it happens, that we live our lives in chains and we never even know we have the key." The Eagles, "Already Gone" The Beatles were wrong: 1 & 1 & 1 is 1
Hi,

htsoft.com has the pacific C

Regards Jens

"John Wilkinson" <john.wilkinson@philips.com> skrev i en meddelelse
news:ff0yg393dw7q$.x6somhk77uvk$.dlg@40tude.net...
> Hi, > I am new to all this but I am about to try my first embedded design
using
> an 80C186 processor. > Is there a free C compiler available? > Am I correct in thinking gcc can't target the 80186 processor? > > I understand I need a locator as well? > Again is there a free one? > > Where can I get startup code? The book I have is Programming Embedded > Systems by Michael Barr, and he says that you could use libgloss, but I > can't find it anywhere on the internet!! > > Best regards, > John.
> I am new to all this but I am about to try my first embedded design > using an 80C186 processor. > Is there a free C compiler available? > Am I correct in thinking gcc can't target the 80186 processor? > > I understand I need a locator as well? > Again is there a free one? > > Where can I get startup code? The book I have is Programming Embedded > Systems by Michael Barr, and he says that you could use libgloss, but > I can't find it anywhere on the internet!!
You can download TurboC 2.01 from Borland's museum. This includes the startup code. YOu would have to avoid most of the library stuff if you aren't using DOS in any form. You will need a locator; I'd Google for one. I found several articles on them a couple of years ago. Andrew
"John Wilkinson" <john.wilkinson@philips.com> wrote in message 
news:ff0yg393dw7q$.x6somhk77uvk$.dlg@40tude.net...
> Hi, > I am new to all this but I am about to try my first embedded design using > an 80C186 processor. > Is there a free C compiler available? > Am I correct in thinking gcc can't target the 80186 processor? > > I understand I need a locator as well? > Again is there a free one? > > Where can I get startup code? The book I have is Programming Embedded > Systems by Michael Barr, and he says that you could use libgloss, but I > can't find it anywhere on the internet!!
My first choice -- because I have it -- is the ancient Borland C++ v3.1 which you can probably find on eBay for a song or two. I've used it in years past to create stand-alone programs that ran on an 80188 but it takes some custom startup code to get rid of the dependency on DOS. Second choice would be Microsoft C++ v1.5x with the same caveats. You might even be able to get by with the DJGPP MS-DOS compiler if you can limit the processor target to 8086/186. Again you'll have to write your own startup code. As for startup code, decades ago the company I worked for bought a product called C_Thru_ROM which was a library of startup and simple CRTL-substitutions to enable writing embedded software for x86 processors with commercial (MS-DOS) compilers. It was rare then and I haven't seen any in the years since but you might find a copy. Also, the company that makes it -- http://www.datalight.com -- now makes a ROM-able MS-DOS emulator. Norm
John Wilkinson wrote:
> Hi, > I am new to all this but I am about to try my first embedded design using > an 80C186 processor. > Is there a free C compiler available? > Am I correct in thinking gcc can't target the 80186 processor? > > I understand I need a locator as well? > Again is there a free one? > > Where can I get startup code? The book I have is Programming Embedded > Systems by Michael Barr, and he says that you could use libgloss, but I > can't find it anywhere on the internet!! >
bcc (Bruce's C Compiler) would do that. GCC i not targeted for 16 bit 80x86 code. Why 80186 (or 80188)? The architecture is obsolete, so I'd avoid it in new designs. An ARM could do the same with modern tools and plenty of more power. The 80186 startup code is much dependent on the hardware environment - the first thing is to open up the ROM chip select so the whole chip is available, and next, to open the other chip selects. -- Tauno Voipio tauno voipio (at) iki fi
On Fri, 30 Sep 2005 12:02:07 +0100, John Wilkinson
<john.wilkinson@philips.com> wrote:

>Hi, >I am new to all this but I am about to try my first embedded design using >an 80C186 processor. >Is there a free C compiler available?
IIRC, there was a book on programming embedded DOS systems that included a Borland 3.something C compiler. You might look in the Borland Museum as well, though I think that stuff is older. Someone else mentioned OpenWatcom, which might work as well.
>Am I correct in thinking gcc can't target the 80186 processor?
That's my understanding.
> >I understand I need a locator as well? >Again is there a free one?
John Fine has written jloc which should do what you want. He calls it "zero price shareware," which means he wants you to register it if you use it, but he dosn't charge you anything for it. See http://my.execpc.com/~geezer/johnfine/ for more info.
> >Where can I get startup code? The book I have is Programming Embedded >Systems by Michael Barr, and he says that you could use libgloss, but I >can't find it anywhere on the internet!!
The 80C186 user's manual from Intel (if you can find one) pretty much describes most of what you need for the chip. And it's important for things like setting up the chip selects. libgloss I suspect is for handling C initialization requirements and to call main. With a locator, you don't necessarily have to do all that, just jump to a routine called "_start" or some such. Although you should probably have a routine to zero static RAM, etc. That means you'll have to explicitly initialize static variables in your code (rather than declaring them with an initializer), but usually that's a small price to pay (as long as you don't forget...) HTH, -=Dave -- Change is inevitable, progress is not.
On Fri, 30 Sep 2005 11:31:42 GMT, Richard wrote:

> >"John Wilkinson" <john.wilkinson@philips.com> wrote in message >news:ff0yg393dw7q$.x6somhk77uvk$.dlg@40tude.net... >> Hi, >> I am new to all this but I am about to try my first embedded design using >> an 80C186 processor. >> Is there a free C compiler available? >> Am I correct in thinking gcc can't target the 80186 processor? >> >> I understand I need a locator as well? >> Again is there a free one? >> >> Where can I get startup code? The book I have is Programming Embedded >> Systems by Michael Barr, and he says that you could use libgloss, but I >> can't find it anywhere on the internet!! >> >> Best regards, >> John. > > >http://www.openwatcom.org/ can target 186 and is free. It creates .exe's >however that run on top of DOS and it sounds like you just have a bare >board. However the compiler source code is available so if nothing else you >might be able to get the startup code. There are free DOS versions around >should that make it easier for you.
The next release of Openwatcom (1.4) has specific support for embedded work, you do not need a locator anymore, the linker will do it for you. Note that OW is a cross-compiler, you can use it to create embedded code whether you run the Windows, OS/2 or DOS. Mat Nieuwenhoven
> The next release of Openwatcom (1.4) has specific support for embedded
work,
> you do not need a locator anymore, the linker will do it for you.
That is good news. I just had a quick look on the site and cannot see a release date mentioned. Do you know roughly when this might be? Regards, Richard. http://www.FreeRTOS.org