是否有针对 8086 的 C 编译器? [英] Is there a C compiler that targets the 8086?

查看:32
本文介绍了是否有针对 8086 的 C 编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 8086 CPU 模拟器.它仅模拟 8086 条指令.我现在正在寻找一个 C 编译器来定位这个模拟器.有没有可以做到这一点的C编译器?

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?

另外,拥有一个可用的 libc 等对我来说并不重要.模拟器使用自定义(即非 PC)硬件,因此任何 libc 甚至 ctr0 可能都必须重写

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 的 C 编译器

来自 bcc(1) - Linux 手册页:

说明

Bcc 是一个简单的 C 编译器,可以生成 8086 汇编程序,此外编译器编译时选项允许 80386 或 6809 版本.编译器理解传统的 K&R C,只是限制了位字段映射到其他整数类型之一.

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.

默认操作是从源文件中生成一个名为 a.out 的 8086 可执行文件.

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

打开 Watcom

来自 0 的描述="noreferrer">打开 Watcom C/C++ 用户指南(PDF 链接):

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

(仅限 16 位)编译器将仅使用生成的目标代码中的 8086 条指令.这是默认.生成的代码将在 8086 和所有向上兼容的处理器上运行.宏 __SW_0如果选择0"将被预定义

(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

这篇关于是否有针对 8086 的 C 编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆