Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to index page
Thread view  Board view
iw2evk

Magenta (Italy),
16.12.2025, 13:06
 

how compile with turbo c (Developers)

Hi all,

i've a program wrote in turbo c for dos.
I see many .c .prj and .hex fiels, but nothing like .configure or other files to be launch for start compilation.

So .
1) what is the last downlodable version of turbo c for dos?

2) how i can compile ?

for information the souce i've stored in thi splace

https://app.box.com/s/su9vth8ejgbg7sguxe0fa780t0j6zujg

Many thanks for attention

Regards

Iw2evk Roberto

Milan

bencollver

Homepage

16.12.2025, 15:51

@ iw2evk
 

how compile with turbo c

I haven't used Turbo C since the 90's but here are a link in case it helps:

> 1) what is the last downlodable version of turbo c for dos?

Turbo C 2.0 from the Embarcadero Borland Museum.

> 2) how i can compile?

Here's a book about "how to".

https://archive.org/details/a-to-z-of-c

rr

Homepage E-mail

Berlin, Germany,
16.12.2025, 18:24

@ bencollver
 

how compile with turbo c

> > 1) what is the last downlodable version of turbo c for dos?
>
> Turbo C 2.0 from the Embarcadero Borland Museum.

Turbo C++ 1.01 is newer and should also be able to compile C code.

---
Forum admin

bocke

17.12.2025, 08:57

@ rr
 

how compile with turbo c

Is TC++ 1.01 C support better than TC 2.0? What are the differences between size and speed of binaries generated by both?

bocke

17.12.2025, 09:01
(edited by bocke, 17.12.2025, 15:47)

@ bocke
 

how compile with turbo c

Edit: asking wrong questions, so deleted the original post.

Basically, I am interested in differences in size (Does it link in C++ runtime or not? If not, are included startup + lib sizes bigger or approximately same size as TC 2.0?) and in speed (does TCPP generated binaries run as fast as TC ones?).

rr

Homepage E-mail

Berlin, Germany,
17.12.2025, 17:43

@ bocke
 

how compile with turbo c

> Is TC++ 1.01 C support better than TC 2.0? What are the differences between
> size and speed of binaries generated by both?

IIRC TC2 RTL had a few bugs, which should be fixed in TCPP1.

---
Forum admin

mceric

Germany,
16.12.2025, 21:37

@ iw2evk
 

how compile with turbo c

Hi!

> i've a program ... in turbo c for dos.
> I see many .c .prj and .hex ... nothing like .configure or other
> files to be launch for start compilation.
>
> 2) how i can compile ?

There is no configure, but there is make.

So you can do:

make clobber
make all
make clean

This will first remove all leftovers from previous compiles, then compile everything, then remove all object files, leaving only the final exe.

You must have turboc.cfg in your current directory.

Your actual makefile might look similar to this, taken from FORMAT:


CC=tcc
CFLAGS=-M -N -ln -w -a- -f- -f87- -DDEBUG -ms -r-
# smaller: -M -O -N -Z -w -a- -f- -ms
# minimalistic: -ms
# -M linkmap -O jump optimize -N stack check -Z register optimize
# -w warnall -a- no word align -f- no fpu emulator -f87- no fpu code
# -ms small memory model -ln no default libs linked ...
# -r register variables -k standard stack frame ...
LDFLAGS=
LDLIBS=
RM=command /c del
OBJS1=createfs.obj floppy.obj hdisk.obj main.obj savefs.obj bcread.obj prf.obj
OBJS2=userint.obj driveio.obj getopt.obj init.obj recordbc.obj uformat.obj

# build targets:

all: format.exe

format.exe: $(OBJS1) $(OBJS2)
        $(CC) $(CFLAGS) $(LDFLAGS) -eformat *.obj $(LDLIBS)

# compile targets:

# very convenient but not available in Turbo C 2.01 - generic C/OBJ rule:
# .c.obj:
#       $(CC) $(CFLAGS) -c $*.c

createfs.obj:
        $(CC) $(CFLAGS) -c createfs.c

floppy.obj:
        $(CC) $(CFLAGS) -c floppy.c

...

# clean up:

clean:
        $(RM) *.obj

clobber:
        $(RM) *.bak
        $(RM) *.dsk
        $(RM) *.exe
        $(RM) *.obj
        $(RM) *.swp


Unfortunately, Turbo C make seems to want one rule for each obj file you compile, no wildcard rule support. Also, you have to use tabs, not spaces, for the indented lines.

---
FreeDOS / DOSEMU2 / ...

Rugxulo

Homepage

Usono,
17.12.2025, 03:43

@ mceric
 

how compile with turbo c

> Hi!
>
> > i've a program ... in turbo c for dos.
> > I see many .c .prj and .hex ... nothing like .configure or other
> > files to be launch for start compilation.
> >
> > 2) how i can compile ?
>
> There is no configure, but there is make.

./configure is GNU-style for a POSIX shell (e.g. bash). While DJGPP does have a port of Bash, I believe ./configure won't really work (much, if at all) except under old 32-bit Windows' NTVDM.

Actually, you may have some success under DOSEMU2.

> So you can do:
>
> make clobber
> make all
> make clean
>
> This will first remove all leftovers from previous compiles, then compile
> everything, then remove all object files, leaving only the final exe.

Overkill, a .BAT would work just as well in 90% of cases, honestly.

The only advantage to a makefile is to (allegedly) save compilation time (and effort, not recompiling without changes) or be portable (e.g. GNUmakefile).

> You must have turboc.cfg in your current directory.

Since DOS 3.0, it should work from the .EXE directory too.

BTW, I still see bad makefiles using TLINK directly (with absolute paths!) instead of TCC. That is never necessary.

> Your actual makefile might look similar to this, taken from FORMAT:
> ...
> # very convenient but not available in Turbo C 2.01 - generic C/OBJ rule:
> # .c.obj:
> # $(CC) $(CFLAGS) -c $*.c

Are you sure? I know TC 2.01 (and TP 5.5) have a much weaker MAKE, but it should work there too. But I honestly don't remember.

At worst, you can use a different make (e.g. Wmaker or Dmake). At least Dmake (and TC++ 1.01 Make) let you swap out to save memory.

> Unfortunately, Turbo C make seems to want one rule for each obj file you
> compile, no wildcard rule support. Also, you have to use tabs, not spaces,
> for the indented lines.

Are you sure? I know TC++ 1.01 Make allows that. Dmake is also quite friendly.

Check these old makefiles I made for NASM:

* http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/devel/asm/nasm/0.98.39/8086host/n16tcmak.zip

kerravon

E-mail

Ligao, Free World North,
18.12.2025, 19:58

@ Rugxulo
 

how compile with turbo c

> > # very convenient but not available in Turbo C 2.01 - generic C/OBJ
> rule:
> > # .c.obj:
> > # $(CC) $(CFLAGS) -c $*.c
>
> Are you sure? I know TC 2.01 (and TP 5.5) have a much weaker MAKE, but it
> should work there too. But I honestly don't remember.

This plus other messages inspired me to check what the status
of Turbo C++ 1.01 was in pdpclib. I had to make changes to get
it to build again. And more changes for it to work with Turbo C 2.01.
And changes to make it work with masm from the DOS 4.0 distribution too.

And I can report:

As per:

https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpclib/makefile.dos

.c.obj works fine.

pdmake for DOS works fine.
nmake works fine
wmake works fine
make (Borland) works fine.

Note that if for any reason you are ever in front of an 8088/8086 (like
the Book 8088 that was released a couple of years ago), with only
real mode available, your choices of free compiler and assembler
were realistically limited to just Turbo C++ 1.01 and wasmr.exe

But now masm.exe is available.

And Microsoft C 5.1 is available too, for the compiler, but it's missing
too much C90 stuff for some of my (reasonable) code to work. 6.0
is fine, but not freely available.

I recommend pdmake as the make program - public domain C90
source code provided so you can use it on any platform, and there
are no restrictions.

You can keep it, sell it, or any other suggestions you can think of:

https://www.ratman.biz/archive/young_ones/boring.html

BFN. Paul.

kerravon

E-mail

Ligao, Free World North,
18.12.2025, 20:01

@ kerravon
 

how compile with turbo c

Oh - and one other suggestion for the OP.

If you don't like the C runtime library provided by Borland, you can
replace it with the PDPCLIB C library.

Same deal - public domain, C90-compliant other than the necessary
assembler.

BFN. Paul.

kerravon

E-mail

Ligao, Free World North,
19.12.2025, 04:47

@ kerravon
 

how compile with turbo c

> And Microsoft C 5.1 is available too, for the compiler, but it's missing
> too much C90 stuff for some of my (reasonable) code to work. 6.0
> is fine, but not freely available.

I went to see the scope of this problem, and I was surprised to find
that PDPCLIB was able to be built with this compiler.

It was PDOS (actually, pcomm.c) that had some issues - with initialization
of automatic arrays.

There is only a small amount of such code, so I think I will just work
around the issue so that I can use Microsoft C 5.1 for development.

I have committed the changes.

kerravon

E-mail

Ligao, Free World North,
19.12.2025, 09:02

@ kerravon
 

how compile with turbo c

> I went to see the scope of this problem, and I was surprised to find
> that PDPCLIB was able to be built with this compiler.

makefile.m86 is the one for MSC 5.1:

https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpclib/makefile.m86

Rugxulo

Homepage

Usono,
17.12.2025, 03:47

@ iw2evk
 

how compile with turbo c

> i've a program wrote in turbo c for dos.
> I see many .c .prj and .hex fiels, but nothing like .configure or other
> files to be launch for start compilation.

PRJ is for inside the IDE. (For example, I think OpenWatcom has a PRJ2MAK program to convert them.)

Not sure what HEX is for.

> 1) what is the last downlodable version of turbo c for dos?

TC++ 1.01 (1991) was the latest freeware, but I don't think they offer it directly anymore.

> for information the souce i've stored in thi splace

What was the original .ZIP archive name? What URL did it originate from? What is it called? What does it do? What is the license?

rr

Homepage E-mail

Berlin, Germany,
17.12.2025, 17:46

@ Rugxulo
 

how compile with turbo c

> > 1) what is the last downlodable version of turbo c for dos?
>
> TC++ 1.01 (1991) was the latest freeware, but I don't think they offer it
> directly anymore.

Some links on https://www.bttr-software.de/links/#asm still work these days. ;-) TCPP is among the working ones.

---
Forum admin

Rugxulo

Homepage

Usono,
17.12.2025, 21:18

@ rr
 

how compile with turbo c

> Some links on https://www.bttr-software.de/links/#asm still work
> these days. ;-) TCPP is among the working ones.

Your links to TC and TCPP give me "Not found" errors.

IIRC, TC 2.01 is a smaller compiler, of course, but it does have a few quirks. It uses pre-standard CLK_TCK (or whatever) instead of CLOCKS_PER_SEC. Also, the default buffering is horribly slow (unlike TC++).

No, I'm not aware of any extra C++ bloat being added to plain C binaries. In fact, that reminds me, FreeDOS FIND fixed a bug by being recompiled with TC++.

kerravon

E-mail

Ligao, Free World North,
18.12.2025, 15:16

@ Rugxulo
 

how compile with turbo c

> > Some links on https://www.bttr-software.de/links/#asm still work
> > these days. ;-) TCPP is among the working ones.
>
> Your links to TC and TCPP give me "Not found" errors.

The readme.txt for PDOS had a link to Turbo C++ 1.01.
I have now added a link to Turbo C 2.01.

The links are:

https://web.archive.org/web/20060114221019/http://...ty.borland.com/article/images/21751/tcpp101.zip

https://web.archive.org/web/20060110183846/http://...nity.borland.com/article/images/20841/tc201.zip

Both working.

If you want the actual articles, they are here:

https://web.archive.org/web/20060111143737/http://community.borland.com/article/0,1410,21751,00.html

https://web.archive.org/web/20060110183846/http://community.borland.com/article/0,1410,20841,00.html


I think I added them to Wikipedia at one point, but they both appear to have been deleted.

rr

Homepage E-mail

Berlin, Germany,
18.12.2025, 20:57

@ Rugxulo
 

how compile with turbo c

> > Some links on https://www.bttr-software.de/links/#asm still work
> > these days. ;-) TCPP is among the working ones.
>
> Your links to TC and TCPP give me "Not found" errors.

The clever people click on the floppy icon in front of each list entry. :lol:

---
Forum admin

Oso2k

19.12.2025, 06:11

@ rr
 

how compile with turbo c

> > > Some links on https://www.bttr-software.de/links/#asm still
> work
> > > these days. ;-) TCPP is among the working ones.
> >
> > Your links to TC and TCPP give me "Not found" errors.
>
> The clever people click on the floppy icon in front of each list entry.
> :lol:


@rr - Dave Dunfield has a new download sites and now makes some sources available.

https://dunfield.themindfactory.com/dnld.htm

https://dunfield.themindfactory.com/dnldos.htm

https://dunfield.themindfactory.com/dnldsrc.htm

RayeR

Homepage

CZ,
19.12.2025, 03:08

@ Rugxulo
 

how compile with turbo c

> No, I'm not aware of any extra C++ bloat being added to plain C binaries.
> In fact, that reminds me, FreeDOS FIND fixed a bug by being recompiled with
> TC++.

I use Borland C++ 3.1 for few DOS stuff in C and don't see any C++ runtimes linked in. Simple helloworld is about 8,6kB.

---
DOS gives me freedom to unlimited HW access.

bocke

20.12.2025, 15:18

@ RayeR
 

how compile with turbo c

> I use Borland C++ 3.1 for few DOS stuff in C and don't see any C++ runtimes
> linked in. Simple helloworld is about 8,6kB.

Thanx RayeR, RR and Rugxulo for the answers.

Noted. TCPP++ doesn't bloat C programs (or at least doesn't bloat them much), but brings fixes to C stdlib and better support for ANSI C (89/90).

Back to index page
Thread view  Board view
23154 Postings in 2179 Threads, 404 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum