0

How do I compile my VC++ project to a 16-bit flat object file for use in my bootloader I am working on?

To my understanding, an object file is technically already "flat" and the linker turns it into the destination executable format. What I want it to be able to obtain that object file and pass that and my assembly code (in obj format) through the linker to create a flat bootloader.

The [guide][1] is not very specific on where the files are located and just says that you use cl.exe, link.exe, and ml.exe (MASM).

The guide uses MASM, but I know how to output object files with NASM. My main problem is the VC++ thing.

Cole Tobin
  • 9,206
  • 15
  • 49
  • 74

1 Answers1

1

The last 16-bit compiler from Microsoft was VC++ 1.52c. It's ancient, and probably not available any more. Even if it was, chances are pretty good that it wouldn't compile any recent code. Just to name a few of its most obvious shortcomings, it had no support for templates, exception handling, or namespaces at all.

I believe most people working on things like that any more use Open Watcom (which isn't exactly up to date either, but still better than VC++ 1.52c).

Jerry Coffin
  • 476,176
  • 80
  • 629
  • 1,111
  • is watcom only available as installer? I would like to distribute it with my SVN code to make compilation easier... – Cole Tobin May 03 '12 at 04:42
  • @ColeJohnson: It's available as source code. From there packaging as you see fit is mostly a question of how ambitious you feel. – Jerry Coffin May 03 '12 at 04:44
  • and does it output object files at all? – Cole Tobin May 03 '12 at 04:45
  • @ColeJohnson: Yes, it produces object files (16-bit OMF, if memory serves). I don't remember for sure whether it's written in C++ or C (probably rather C-ish C++ by current standards); unless I'm badly mistaken, it's self-compiling. – Jerry Coffin May 03 '12 at 04:50