I'm looking for a C cross-compiler and emulator for a 16-bit processor that runs under Linux. I'd prefer for the target to be 8086 with FreeDOS or on Dosemu (then finding an emulator is not a problem). One limiting factor is that it needs to support 64-bit arithmetic.
The goal is to port and test some code that currently targets 32-bit embedded systems to 16-bit systems for which I don't have easy access development tools and emulators. The code is mostly portable apart from currently assuming that int
is 32-bit, so any 16-bit target will do for the continuous integration testing.
The constraints:
- The compiler and the emulator must run under Linux, in an automated build and test environment.
- In the emulator, I need to be able to run my program and get data in and out. I would need either a basic OS, or some code to link into my program to implement serial or file I/O (ideally both but as long as I have a way to provide the test data and retrieve the results it should be fine). DOS (on 8086) would be nice because there's existing tooling around it, but it isn't a requirement.
- The software should be free to run. A license that doesn't allow redistributing the binaries produced by the compiler would be ok (I only need the binaries for internal testing). A license that prohibits all commercial use wouldn't work for me right now (although I might get a purchase approval later).
The compiler needs to support the following features:
- 8-bit
char
- 16-bit
int
- Ideally C99, but if not then at least 64-bit integers (
uint64_t
). - The better the warnings about integer sizes the better, since this is code that hadn't been written for a 16-bit target in the first place.
- 8-bit