Compiling to a binary file

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
john_k

Compiling to a binary file

Post 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...
uri

RE:Compiling to a binary file

Post 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
uri

RE:Compiling to a binary file

Post by uri »

I've made a mistake in the post above - it should be the "tiny" memory model (IIRC)
carbonBased

RE:Compiling to a binary file

Post by carbonBased »

and btw, that fixed entry point is at offset 100... if I'm remembering correctly... been a while :)

Jeff
Post Reply