16bit code generation

Ben Klein shacklein at gmail.com
Sat Mar 21 19:34:03 CDT 2009

Oops, missed reply-to-all.

2009/3/22 Tijl Coosemans <tijl at ulyssis.org>:
> I was reading through binutils documentation and came across this.
> Maybe it can be used to compile 16 bit tests.
> 3.2.4. 16-bit mode
> Binutils ( now fully support 16-bit mode (registers and
> addressing) on i386 PCs. Use .code16 and .code32 to switch between
> assembly modes.
> Also, a neat trick used by several people (including the oskit authors)
> is to force GCC to produce code for 16-bit real mode, using an inline
> assembly statement asm(".code16\n"). GCC will still emit only 32-bit
> addressing modes, but GAS will insert proper 32-bit prefixes for them.

16bit mode is required for building bootloaders. The question here is,
is it possible for Wine to run raw 16bit code when running under a
*nix kernel, which typically (always?) run in protected mode? I
believe it is not possible without some sort of 16bit emulator/wrapper
(e.g., current win16 libs are actually compiled as 32bit).

More information about the wine-devel mailing list