3 ms·
Are there even any other free/libre C compilers that can produce 16-bit DOS binaries?
by dark-star 2y ago
Are there even any other free/libre C compilers that can produce 16-bit DOS binaries?
- londons_explore 2y agoI assume gcc can do it, since gcc can target far smaller/more complex/more niche 8 bit architectures.
- rwmj 2y agoGCC (and clang) can definitely do it. We use it to write option ROMs in C in qemu. This code is compiled with the `-m16` option. This particular code references 32 bit registers using 66h prefix so wouldn't work on an 8086, but AFAIK that's not a general problem: https://gitlab.com/qemu-project/qemu/-/blob/master/pc-bios/optionrom/linuxboot_dma.c?ref_type=heads https://gitlab.com/qemu-project/qemu/-/blob/master/pc-bios/o...