16Bit C Code

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
PlayOS

16Bit C Code

Post by PlayOS »

Hi,

How can I write 16bit code using GCC?

Thanks.
Tim

Re:16Bit C Code

Post 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.
Post Reply