68000,可移植的JIT库

发布于 2024-11-01 16:38:05 字数 291 浏览 3 评论 0原文

有多个 JIT 库,但是否有任何库可以发出 Motorola 68000 风格的指令,例如 68000、68040、68060 或任何 Coldfire CPU?

如果它也可以为其他平台发出奖励积分,但 68k 是最重要的。

易于与 C 集成的语言是首选,但其他语言也很有趣。

理想情况下类似于 libjit,但具有 68k 后端。

There are several JIT libraries, but is there any which emits Motorola 68000 style instructions, such as for instance 68000, 68040, 68060 or any of the Coldfire CPUs?

Bonus points if it could emit for other platforms too, but 68k is most important.

Something easily integrated with C is preferred, but other languages are interesting too.

Ideally something like libjit, but with a 68k backend.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巷雨优美回忆 2024-11-08 16:38:05

虽然这并不能真正回答您的问题,但您可以考虑自己生成 68k 机器代码。如果您已经熟悉 68k 汇编,那么这应该不会太困难。

Motorola M68000 系列程序员参考手册 记录了语法、可用性、以及每个 680x0 指令的位配置。然而,计算指令机器代码的一种不太繁琐的方法是使用 68k 汇编器,它可以为生成的每条指令生成十六进制代码列表。如果您使用的是 Windows,Easy68K 应该能够生成这样的列表,但我还没有尝试过我。

如果您不在 Windows 上,您可以尝试 这个汇编器(我认为仅支持 68000)。您必须将其上的灰尘吹掉,但它可以工作(至少在 Linux 中)。命令行汇编器 (assembler/asm) 有一个 -l 标志,告诉汇编器生成一个列表。示例:

$ asmlab/assembler/asm -ln test.asm
68000 Assembler by PGM

No errors detected
No warnings generated

test.asm

每条指令之前都需要有前导空格,而汇编器不能很好地处理标记之间的空格。

 move.l #$12345678,-(a6)
 jmp ($12345678)
 rts

test.LIS

00000000  2D3C 12345678                      1   move.l #$12345678,-(a6)
00000006  4EF9 12345678                      2   jmp ($12345678)
0000000C  4E75                               3   rts

No errors detected
No warnings generated

Although this doesn't really answer your question, you could consider generating the 68k machine code yourself. It shouldn't be too terribly difficult if you are already familiar with 68k assembly.

The Motorola M68000 Family Programmer's Reference Manual documents the syntax, availability, and bit configuration of every 680x0 instruction. However, a less tedious way to figure out the machine code for instructions is to use a 68k assembler that can generate a listing of the hex codes for each instruction produced. If you're on Windows, Easy68K should be able to generate such a listing, but I haven't tried it myself.

If you're not on Windows, you could try this assembler (only supports 68000, I think). You'll have to blow the dust off of it, but it works (at least in Linux). The command-line assembler (assembler/asm) has a -l flag that tells the assembler to generate a listing. Example:

$ asmlab/assembler/asm -ln test.asm
68000 Assembler by PGM

No errors detected
No warnings generated

test.asm

Leading space is required before each instruction, and the assembler doesn't handle whitespace between tokens well.

 move.l #$12345678,-(a6)
 jmp ($12345678)
 rts

test.LIS

00000000  2D3C 12345678                      1   move.l #$12345678,-(a6)
00000006  4EF9 12345678                      2   jmp ($12345678)
0000000C  4E75                               3   rts

No errors detected
No warnings generated
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文