Page 1 of 1
Compiling 16 bit C++
Posted: Tue Sep 09, 2008 1:13 pm
by matematik
How can I compile 16 bit c++ code on linux? I tried g++, but i seems, it only support 32 and 64 bit code.
Re: Compiling 16 bit C++
Posted: Tue Sep 09, 2008 1:48 pm
by Combuster
GCC assumes a flat memory model (i.e. access to all 4 GB) and no segmentation (DS=ES=SS). If you want to have real mode code, then those assumptions are not valid and you're stuck.
Otherwise, you can tell the assembly part of GCC to use 16-bits as the default size via the .code16gcc directive, which essentially means that it will tell the processor for each instruction to treat it as 32 bits.
If you really want a native real mode C++ compiler, you should try a DOS-era compiler. Turbo C springs to mind
Re: Compiling 16 bit C++
Posted: Tue Sep 09, 2008 3:34 pm
by Brynet-Inc
Open Watcom might be an option.. try their
site.
Re: Compiling 16 bit C++
Posted: Wed Sep 10, 2008 5:55 am
by DeletedAccount
I think , you can use Dosbox to run Turbo C++ in Linux