开发者

Is there a C compiler that targets the 8086? [closed]

开发者 https://www.devze.com 2023-01-31 06:44 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_开发知识库

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 3 years ago.

The community reviewed whether to reopen this question 2 months ago and left it closed:

Original close reason(s) were not resolved

Improve this question

I have an 8086 CPU emulator. It emulates only 8086 instructions. I am searching now for a C compiler to target this emulator with. Is there any C compiler out there that can do this?

Also, having a usable libc and such is not important to me. The emulator uses custom(ie, non-PC) hardware and therefor any libc or even ctr0 would probably have to be rewritten anyway


bcc - Bruce's C compiler

From bcc(1) - Linux man page:

Description

Bcc is a simple C compiler that produces 8086 assembler, in addition compiler compile time options allow 80386 or 6809 versions. The compiler understands traditional K&R C with just the restriction that bit fields are mapped to one of the other integer types.

The default operation is to produce an 8086 executable called a.out from the source file.

Open Watcom

From the description of compiler option / 80x86 run-time convention 0 in Open Watcom C/C++ User’s Guide (PDF link):

(16-bit only) The compiler will make use of only 8086 instructions in the generated object code. This is the default. The resulting code will run on 8086 and all upward compatible processors. The macro __SW_0 will be predefined if "0" is selected


  • Open Watcom
  • Digital Mars
  • bcc


Free Pascal can also produce 16 bit 8086 executable. It is not a native compiler, you have to compile it on your contemporary 32/64 bit machine and then copy the executable to your 16 bit IBM 51XX or clone.

gcc-ia16 TK Chia's GCC compiler targeted for 8086. It is actively developed. It is used to compile a huge 16 bit project such as ELKS Linux and all its applications. It is also not a native compiler.

0

精彩评论

暂无评论...
验证码 换一张
取 消