- Joe
dunno, but at least there is this.
once, I was faced with this problem, and lacking a compiler (this was before
I really had much experience in compiler writing, but all my stuff is 32 and
64 bit), just ended up writing these components in assembler.
> - Joe
A good answer?...
dev86 is supposedly an improved version of bcc used for ELKS.
http://homepage.ntlworld.com/robert.debath/
DJ Delorie's "DJGPP 16-bit Toolset" might be ported or workable on Linux.
http://www.delorie.com/djgpp/16bit/
GAS has 16-bit assembly support which also works with GCC's inline assembly.
DJGPP's webpage on the subject:
http://www.delorie.com/gnu/docs/binutils/as_270.html
Ok, now for other 32-bit C compilers for Linux. I just mention these
because some of them are simple enough they could be ported or converted.
But, of course, they are simple C compilers, i.e., have limitations. The
Simple C Compiler appears to have a single array of 32-bit instructions
which should be easy to replace. I'm not sure about adjusting the internal
integer sizes... Small C for I386 (IA-32) was ported to C but was converted
to 32-bits in the process... Most of the changes are trivial, but it also
has some bugs. With some work comparing to older Small C's, you should be
able to convert back to 16-bit.
Small C for I386 (IA-32) - 32-bit port of Ron Cain's Small C to Linux.
http://www.physics.rutgers.edu/~vitchev/smallc-i386.html
Simple C Compiler - 32-bit port of Ron Cain's Small C to Linux
http://retro.tunes.org/simplec/
Tiny C Compiler
http://bellard.org/tcc/
PCC (Portable C Compiler)
http://pcc.ludd.ltu.se/
HTH,
Rod Pemberton
Turbo C 2.0
Turbo C++ 3.0
Using GAS you can translate your 32 bit C/C++ programs into 16 bit
real mode programs; But the instruction set for the 8086 isn't fully
supported. You'll have to supplement with inline asm. The linux kernel
uses this method for its real mode stuff, like the E820 memory map and
whatnot.
At the top of every C/C++ file which should be output as 16 bit 8086
instructions, add the following directive to AS:
asm volatile(".code16gcc\n\t");
GCC passes all inline ASM directly to GAS. The directive will look to
GAs as if you had written out an ASM file and put the directive there
yourself.
Thanks for the help, I think i'll use this option for now
- Joe