Page 1 of 1

Compiling to a binary file

Posted: Wed Mar 31, 2004 12:00 am
by john_k
hi,

  I cant figure out how to compile a simple hello world *.c file into binary (.bin) using turbo C compiler 2.0..

  Program

/********* Hello World Program **************/

main()
{
  puts ("Hello Worlds");
}
/*********************************************/



   if you can help me  please include an example batch script for this... thank you very much, in advance...

RE:Compiling to a binary file

Posted: Thu Apr 01, 2004 12:00 am
by uri
AFAIK, Turbo C can't output flat binary files. If you compile and link your code with the "small" memory model, you could at least convert the resulting EXE to a COM file using exe2bin. A COM file is nothing more than a flat binary with a fixed loading address, so it should be fairly easy to handle.

- uri

RE:Compiling to a binary file

Posted: Thu Apr 01, 2004 12:00 am
by uri
I've made a mistake in the post above - it should be the "tiny" memory model (IIRC)

RE:Compiling to a binary file

Posted: Thu Apr 01, 2004 12:00 am
by carbonBased
and btw, that fixed entry point is at offset 100... if I'm remembering correctly... been a while :)

Jeff