Turbo C: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
(Undo revision 11408 by Love4boobies (Talk) - Destruction of information)
(Added more information about inline assembly and make.exe bug on turbo c 2.01)
Line 1: Line 1:
{{stub}}
{{stub}}
Turbo C (aka TC) is [http://www.borland.com/ Borland's] 16-bit C compiler. In OS development, it is only useful for developing real mode operating systems. TC normally compiles to a DOS .exe executable, but the generated code can be turned into a flat binary by [[exe2bin]] if you compile with the -mt (model tiny) argument to the compiler, which makes the result position-independent.
Turbo C (aka TC) is [http://www.borland.com/ Borland's] 16-bit C compiler. In OS development, it is only useful for developing real mode operating systems. TC normally compiles to a DOS .exe executable, but the generated code can be turned into a flat binary by [[exe2bin]] if you compile with the -mt (model tiny) argument to the compiler, which makes the result position-independent.

== Make bug ==
If you're using Turbo C. There is a chance that the make program that comes in TC hangs indefinitely. To fix this it's necessary to create a makefile that does absolutely nothing. This only happens on Turbo C 2.01.


== Inline Assembly ==
== Inline Assembly ==


Inline assembly works fine in Turbo C, but there are a few rules:
Inline assembly works fine in Turbo C, but there are a few rules:
* You must compile from the command line!
* You must compile from the command line
* You must own [[TASM]] or pass -Exxx to the compiler!
* You must own [[TASM]] or pass -Exxx to the compiler
* Only intel syntax is accepted


-Exxx specifies an alternate assembler to use, eg. -Enasm.exe if you wanted to assemble with [[NASM]].
-Exxx specifies an alternate assembler to use, eg. -Enasm.exe if you wanted to assemble with [[NASM]].

Revision as of 09:32, 22 June 2020

This page is a stub.
You can help the wiki by accurately adding more contents to it.

Turbo C (aka TC) is Borland's 16-bit C compiler. In OS development, it is only useful for developing real mode operating systems. TC normally compiles to a DOS .exe executable, but the generated code can be turned into a flat binary by exe2bin if you compile with the -mt (model tiny) argument to the compiler, which makes the result position-independent.

Make bug

If you're using Turbo C. There is a chance that the make program that comes in TC hangs indefinitely. To fix this it's necessary to create a makefile that does absolutely nothing. This only happens on Turbo C 2.01.

Inline Assembly

Inline assembly works fine in Turbo C, but there are a few rules:

  • You must compile from the command line
  • You must own TASM or pass -Exxx to the compiler
  • Only intel syntax is accepted

-Exxx specifies an alternate assembler to use, eg. -Enasm.exe if you wanted to assemble with NASM.