There are a couple reasons for Turbo C. Probably the main one I guess is the low-level friendly additions Turbo C makes, like the register pseudos like _AH, _AL, _AX, etc. I do actually use a modern editor for Turbo C on most occasions. I write all my code in Notepad++ and then save it to a folder in DOSBox, then just run it in Turbo C. The other reason is just because I heard of it. It was probably the first thing I found, or already saw for a DOS C compiler.
You have to use Turbo C to compile this, because of the register pseudos, as they do not work in any other compilers that I know of (maybe TC++). There's no real reason it shouldn't work in FreeDOS, as it can almost run without DOS. The only thing it really uses from DOS are some delay functions, which could be replaced with either nothing, or the PIT.
Which version of TC did you use? There are some small, intrinsic differences between TC 2.0, TC 3.0, TC++ 1.01, Etc., though your code should compile and run fine in any of them. (TC++ is just a newer version of TC; they just added C++ support to the compiler.)
Actually, all of the popular DOS C compilers allow you to do inline ASM, directly access registers from C code, call interrupts and so on.
Manipulating registers from C code should be as easy as just calling “r->ax = whatever”. That should work with pretty much every compiler (TC, TC++, Borland C, Microsoft C and Watcom C).
Take the FreeDOS kernel for example. It’s written in a mix of C and ASM and will compile in any of above mentioned compilers (however the pure ASM Code is sprinkled with #ifdef statements adding and removing bits on a per compiler basis; that said, the high level C code is pretty clean).
I guess what I’m saying is the C/CPP compilers for DOS were pretty compatible. It’s the ASM products you have to watch out for. (TASM and MASM with all their modes!)
Anyway, I’ll try again with TC. Might be something with my patched version of TCPP.