Free Tools for C-Programmers


Now you know, how I look like: pale as a programmer. Well, that's mostly true, but this year it definitely has something to do with the weather. Do you believe me?

This website is especially dedicated to programmers. As a programmer you will find compilers for DOS like GCC, LCC and TCC and also GCC for Macintosh. You also find Interpreters here like EiC for DOS, WINDOWS, MAC and ATARI and also Little-C as well as Thetis-C for MAC.


So lets start with the compilers. The first is LCC from David Hanson and Christopher Fraser. LCC was originally written for UNIX (that's why I used Metrowerks "X"-logo here), it is also available in several versions for WINDOWS (LCCWIN32 and Pelles-C) and now it's available for 32bit DOS with DPMI.

LCC is a retargetable ANSI-C compiler, running in protected mode. It's partly compiled by GCC from DJGPP. This DOS version of LCC does not use GCC's assembler AS, I changed it to use NASM, the Netwide Assembler.

NASM's syntax is much easier to learn and it's a powerful assembler. You can find many, many sources and examples for writing assembly code with NASM. The linker is LD from GCC. LCC comes complete with ANSI-C header files and it uses the GCC libraries libc.a and libm.a. This version also has a VESA graphics library libg.a. The whole compiler system comes with full sources and can be compiled with GCC very easily and fast.

I included lots of example files and a documentation. LCC is a stable and reliable C-compiler. I tweaked the code generator of LCC, so that the assembler output is now well formatted. LCC now compiler its assembler NASM.

There is a very good book available "A retargetable C Compiler: Design and Implementation", written by Christopher Fraser and David Hanson (Addison Wesley, 1995). This book includes the main parts of the source code and explains in great detail the inner working of this C compiler.


The next ANSI-C compiler system was also made for UNIX by Fabrice Bellard. It's the tiny C-compiler TCC. It is also available for windows and I used the latest binaries, added a dpmi interface for DOS to TCC and also a VESA graphics library (like the one for LCC). There is also another VESA library, which is for 32 bit colors and it is implemented as a DLL, which runs perfectly under DOS with the help of Japeth's HXDOS extender. This DOS version of TCC also produces native Windows binaries (PEF format), which can be run under DOS with the HXDOS extender.

By the way, many Windows based development systems also run under DOS with this HXDOS extender. I also have the CH interpreter and the main part of CINT working on DOS. Seems a little bit like magic, but it's all possible with this extender.

The library is well documented and the compiler as well as its tools like linker and librarian can be compiled with TCC itself. TCC is one of the fastest compiler available. It can also compile directly into memory, avoiding the production of an .exe file. TCC can also be used in shell scripts from BASH or SH under DOS. TCC uses no external linker, it's all done from inside the compiler. The last thing to mention is TCC's inline assembler, which syntax (AT&T) is identical to the one AS from GCC uses.

Like all other packages here, TCC comes with complete sources and documentation. Also included is NASM, which can now be compiled by TCC itself and can be used together with TCC for special assembler modules.

The HXDOS extender is also included here, but I would recommend, that you visit Japeth's own Website to inform yourself about his marvellous peace of software.


What is this EiC-Interpreter?

Let me begin with an actual foreword from Softintegration, the makers of the CH interpreter:

    SoftIntegration Announces Free C/C++ Interpreter Ch Student Edition 6.3
    June 16, 2011 SoftIntegration, Inc. has released free Ch Student Edition v6.3
    for students to learn computing and programming in C/C++ with a user-friendly
    interactive C/C++ interpreter. 

As you can see from this announcement, it's not out of date at all to deal with the interpreting of languages. The chief of Softintegration is itself a member of the C++ standard commitee, so he knows what he is doing. I have a CH-licence for more then 5 years now and I can recommmend this interpreter to everybody (WIN, MAC, UNIX).

You could also visit the website at CERN laboratory in Switzerland:

This is, what CERN's people have to say about CINT:

    What is CINT?

    CINT is an interpreter for C and C++ code. It is useful e.g. for situations
    where rapid development is more important than execution time. Using an
    interpreter the compile and link cycle is dramatically reduced facilitating
    rapid development. CINT makes C/C++ programming enjoyable even for part-time
    programmers.

    CINT is written in C++ itself, with slightly less than 400,000 lines of code.
    It is used in production by several companies in the banking, integrated
    devices, and even gaming environment, and of course by ROOT, making it the
    default interpreter for a large number of high energy physicists all over the
    world.

So why, you might ask is there another C Interpreter. Now, the answer is very easy: because EiC (Extensible, interactive C-interpreter) is a tool for every C programmer and it's one of the best and easiest learning tools I know. Many educational insitutions like universities and others use interpreters to teach programming languages. They are much better suited for this task then large and complicated compiler systems. Interpreters help finding bugs, because they can tell exactly, in which line an error occured. Especially for newcomers it's important to get meaningful error messages, which compilers often fail to do. Interpreters are also much more safe to use.

It's a working and solid peace of handmade software, made by Ed. Breen in the ninetees and deloped by him until 2001 or so on his website. Then it was forgotten by the most, but I decided to port it from it's original Unix systems (VAX, Linux and so on) to other systems like DOS, MACOS, Atari, Windows. EiC is very fast, it has it's own stack machine inside, but it depended on UNIX (POSIX headers). So, I first cleaned it from these UNIX like headers and made it compatible to all other systems, which did not have POSIX like standards, but which had ANSI-C compilers available to make EiC work on their system. It took me quite a long time, to manage this code tweaking but at the end I succeeded and now you can use this interpreter on virtually all systems, including Handhelds, Palmtops etc. The compilation process itself was also drastically made easier and cleaner, only using normal make files (or batch files).

EiC is a complete and clean ANSI-C Interpreter. The DOS version comes packed with my VESA (LFB - linear framebuffer and protected mode) library. It uses one of the best antialiasings available from Nelson. It has also many conio functions, an integrated expression parser, a powerful GIF viewer, a text viewer with C syntax hightlighting and more than 180 examples for graphic and text programming in C.

Everyone who is interested in graphics programming or generally in C programming should have a look at this package, it's a wonderful programming system and absolutely easy and safe to use. EiC can't crash your machine, it's an interpreter for protected mode DOS (max 4 GByte memory) and in rare situations CTRL-C is the solution, which brings you safely back to your DOS shell. EiC gives extensive help for error recovery.

My simple aim was to produce something like a standard example library for basic and advanced graphic algorithms as well as text based programs, which should help people learn how to program in C. The programs itself uses an internal help system to provide additional information.

The whole C-Interpreter system is about 4.5 MBytes in size and it is nicely documented with TeX (EiC ANSI-C library and the graphics library). All sources are included and the whole development systen is free for everybody.


Here you find the actual version of the EiC-Interpreter for DOS and an extra program from Japeth to accellerate the VESA graphics performance through some not well kown Intel tricks (it's in the Intel hardware manuals). You can download this doc as PDF from this site.

The sources of VESAMTRR are included in the archive. Here is a small info about this program:

    VESAMTRR is a tool to set a MTRR for VESA LFB to memory type 01 (WC).
     This may increase video memory write speed on DOS for P3s and P4s.
     In a Windows DOS box it is usually already done by the video driver.
     For more technical information please read the intel manuals.

     This tool requires cpu ring 0 access, so it cannot run on WinXP/2k/NT or
     DOSEMU, and it isn't needed there either.

On my (rather old Dell system) this program can speed up screen clearing from formerly 23 ms to now only 6 ms. This is a rather astonishing speedup, I think.

There are also two iso-images for burning bootable CD's with EiC. They contain EiC without sources, all other files are included. The first one (261) is for 1024x768 screensize and the other (263) is for 1280x1024 screens.The CD boots DOS 7.1 and copies all files to a Ramdisk. You can work directly from that disk. For easy use the Volkov commander is included as a DOS shell. You can simply hit Return on a C-file and EiC is started with that file. An editor is also included on the CD. In Windows you see the additional contents of the CD. It contains the whole EiC package together with GCC for DOS. The DOS extender, used on this CD is the very good HXDOS extender from Japeth. It conforms to the DPMI specification 1.0.

For those who don't have a program to make bootable CD'S, there's a link below for a totally free and working software package to make Boot-CD's from Bart's website. The program UNZIP.EXE can also be downloaded.


The next EiC version is for Windows (95 -> XP). It also has a VESA library, but without the linear frame buffer access (forbidden by Microsoft) and with some other hardware restrictions. So it is a library with bank switching. I'm not a great Windows guru, so I don't know how to manage it to make the mouse work under these restrictions. All other routines are very similar to the DOS version or the Mac version. This version was compiled with MINGW, which is a GCC distrubution for Windows that produces very compact exe files. This GCC distribution is also included here for downloading.


For all of you, who are working with MACOS (Classic or 68k), here are two versions of EiC for Apple's MPW development system, which is now freely available on the internet. EiC for MPW is an ordinary MPW tool (PPC or 68k available) and it includes a graphic library, with many Toolbox functions, Nelson's high quality antialiasing and many more useful graphic functions like Bezier curves and conics.

To minimize troubles in compiling the Interpreter (it's already compiled, so this is for the experienced users), I included a special version of MPW-PPC. I don't want to tell you too much about the contents, but look for yourself, it has much more than only GCC. Like for instance TeX for MPW, Lout for MPW and Lua for MPW. Ghostscript is also included. To make everything work smoothly, There is an additional archive with additions for MPW-PPC. I compiled Lout and Lua by myself. The TeX system was put together from a Lehmanns TeX-CD, which mirrored the Dante TeX-server contents. The additions to MPW are packet together in an extra archive.

Additional I included here two versions of the former Thetis C-Interpreter from Stanford University. It's no longer supported, but it works quite well on 68k or PPC Macs. This interpreter is not so fast as EiC, but it's also a complete and mostly unknown C-Interpreter for Macs. This was my starting point into this subject - I received it from a University friend overseas. This interpreter was formerly used by the Stanford CS-students to learn C-programming. It was maintained by the well known professor Eric S. Roberts, who wrote the very good book "The Art and Science of C", Addison Wesley (1995). It includes his special addition to the ANSI-C headers for a more easy introduction to the C language. Thetis-C can also produce graphics and uses Apples routines internally. It is possible to make own libraries which then can be loaded with program. The interface is very similar to Think-C on the Mac.

Here you'll also find a free-standing graphic library for MPW, which is realized as a single header file. Look at the many examples to see if it's useful for you. The functionality is the same as the EiC graphics library.

For friends of simple tools I included an archive with Herbert Schildt's Little-C Interpreter. Of course, my version is corrected and much more enhanced. Look what it can do, I think quite a lot for such a little peace of code. Like EiC for Mac, it's a standard MPW-tool.

For all friends of TeX, here are some puplicy unknown TeX drawing tools, which I created for my own needs over the past years and which I now give away freely. Until now I didn't contact the official Dante TeX distribuition servers fore my special TeX styles, but I will do that, when I got all the documentations and install files ready. The styles come with many examples, so you can see how they work. There is Laplot for drawing math functions with text and formula integration. Then you'll find Ladraw, a complete drawing environment, which can draw polynomial and even rational (conics and more) Bezier curves up to a degree of seven - all implemented in pure TeX macro code. The next one is LaPost for direct integration of Postscipt into TeX documents and the same for PDF, which is called LaPDF. All these drawing styles for TeX use their own environment like the Picture environment of TeX does.

So, what you get is the ability to draw many kinds of curves (Ladraw also knows simple looping constructs, whis is used in many examples. You can plot functions in high quality on any kind of printer and use PostScript's or PDF's native graphics commands for drawing, which can be used directly in your TeX document without ever leaving the TeX editor.

For the Lout package inside my special MPW version there is the original Lout documentation in source form, which can be compiled into Postscript from the MPW shell. Lout is another language for typesetting documents like TeX. It uses a procedural approach for it's macros, which can be understood easily by anyone who ever programmend in Pascal or C. Lout does not need special fonts other than the standard Postscript TypeI fonts. This makes the compiled Lout document very small, compared to TeX. It's output is PostScript.

Lua is a well known scripting languge, which can also be embedded into other programs. It has much in common with C, but also from functional languages. The MPW version works wonderful and I had no problems to compile it on the Mac. The MPW shell is ideal to work with these kind of tools, because you can use scripts and you have the worksheet window for output with redirection possibilities.

For the curious: I also compiled EiC for MacMint on PowerPC. Allthough we are told that MacMint does not understand Graphics, it was no problem to circumvent this restriction. Just don't tell MacMint, that it deals with graphic and it will do graphics! Sounds a little bit crazy, but it works. I compiled the Atari code, but this time used Apples global pointer to the screen, the mouse and the keyboard. It works great and it uses Apples Bitmap font, like the Atari version does. By the way, the drawing is directly into MacMints shell window, which is restored afterwords. Mint can do graphics, but it does not know this. The compiler used for this, was GCC 2.5.8.


Here is also an EiC version for Atari. It works on all Atari-ST's and on MagiCMac. The archive contains everything including the MagicCMac Demo version. You click on MagicMac and go directly into a shell. There you type 'e' and now you are in the demo files directory of EiC. Type 'c colors' without extension and the batch file calls EiC for Atari and run colors.c. To quit from MagiCMac, simply type 'q' end hit return. To quit EiC programs, you have to hit 'esc' and return. The graphic library is roughly the same as the Windows version and also uses Apples bitmap fonts.


This is the complete GCC package (DJGPP 2.01) for compiling EiC or LCC. As a separate archive you can also download the WEB2C-TeX distribution with Latex and PDFTeX. GCC is used to compile the EiC interpreter and the graphics library. WEB2C TeX is used to typeset the documentation. So you now have all tools at your fingertips for a powerfull compiler/interpreter duo.

At this point I would like to make some notes about Delorie's DJGPP. For me, GCC from this package is the mother of all 32 bit compilers under DOS. It is just amazing, what you can do with GCC. Of course, it's not the fastest compiler, but everything it compiles, is solid rock. Delorie made a fantastic work by developing this complete programming environment for 32 bit DOS. If you look at all the DJGPP websites around the world, you can guess the importance of this software product fore the free programmers community. Thank you Delorie at this place for DJGPP!


The next file is Ghostscript 7.05 for DOS. This version is very stable, with high resolution VESA support, and together with the GCC TeX distribution above you have a complete TeX installment for documentation, which allows you to produce DVI, PostScript or PDF output. GS.EXE uses the DOS4GW extender.

I've tested many of the newer Ghostscript version for DOS, but some where not working at all, others did some of the examples others failed. These newer versions usually use long files names, which is not normally supported by DOS and they are simply one to one compilations of Windows sources with some small driver hackes for DOS, but they are not developed with great care and much testing. This 7.05 version of Ghostscript is absolutely stable (I loaded 10 MB documents without any problems), so it's the last classic DOS version I know of.

This year a PDF viewer, called muPDF for DOS was made available to the public. You find a link to the project site here and also a link to the DOS version of muPDF. The program only needs a single configuration file, everything else is contained in the program file. So, it does not depend on any other files. This program works very well, it shows the text with high accuracy. The only glitch is that it swaps red and blue colors, this will shurely be fixed soon. Now you have a full working PDF viewer for PDF files up to PDF version 1.6. If you have an 1.7 file, you should try to change the version number to 1.6 at the beginning of the PDF file. I've done this for a long time with my hex editor and works for most of the files without problems.


For convenience I added some useful additions to the DOS system, which I placed into a BIN directory. Here you'll find - beside many tools - a very easy to use and also a powerful management for all your development tools under DOS. Look at the AUTOEXEC.BAT, CONFIG.SYS and also the central batch file E.BAT (there are some more for Ghostscript and TeX). Many DOS users have many special batch files to switch from one environment to another. Here you find a general solution for them all.


The End

I hope these programming tools and other utilities are helpful and useful for your own work and I appreciate any (positive or negative) user response. The only restriction I make here is, that it should help to make EiC even better.

Thanks for your interest and happy programming!


Afterword

An average programming cycle.