Compiling 16 bit C++
Compiling 16 bit C++
How can I compile 16 bit c++ code on linux? I tried g++, but i seems, it only support 32 and 64 bit code.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Compiling 16 bit C++
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
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
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: Compiling 16 bit C++
Open Watcom might be an option.. try their site.
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
Re: Compiling 16 bit C++
I think , you can use Dosbox to run Turbo C++ in Linux