Page 1 of 1

16Bit C Code

Posted: Sat Sep 28, 2002 5:45 am
by PlayOS
Hi,

How can I write 16bit code using GCC?

Thanks.

Re:16Bit C Code

Posted: Sat Sep 28, 2002 6:08 am
by Tim
Short answer: you don't.

Long answer: insert the __asm__(".code16gcc") directive at the top of your source file and find a linker which will output 16-bit code properly. gcc and ld were designed to support only 32-bit flat code; 16-bit code is segmented.

Useful answer: download Turbo C or Borland C++ and use that.