General intro: https://alexfru.narod.ru/os/c16/c16.html

Compilers: https://stackoverflow.com/questions/15096609/c-compiler-for-ms-dos

GCC for 386: https://nullprogram.com/blog/2014/12/09/

x86 reference:

DOS reference:

GUI:

Rust:

Line endings:

  • getch() will return \r on enter
  • but if you pipe in a Linux textfile, obviously you will get \n

IDEs:

Open Watcom

int32_t mul16x16(int a, int b);

#pragma aux mul16x16 = \
    "imul dx"       \
    parm [dx] [ax] value [dx ax] modify exact [ax dx];

Detection

Watcom C/C++ compiler: __WATCOMC__

CPU:

16-bit & 32-bit   16-bit     32-bit
=======================================
__X86__            __I86__   __386__
_M_IX86            M_I86     M_I386
                   _M_I86    _M_I386

Note: _M_IX86 is set equal to n*100 where n=0 for 8086, 1 for 80186 etc. up to 5 for Pentium.

Target operating system:

Target          | Macros
================|==========================================
DOS             | __DOS__, _DOS, MSDOS
OS/2            | __OS2__
QNX             | __QNX__, __UNIX__
Netware         | __NETWARE__, __NETWARE_386__
NT              | __NT__
Windows         | __WINDOWS__, _WINDOWS, __WINDOWS_386__
Linux           | __LINUX__, __UNIX__