Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

68000, portable JIT library

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.

like image 502
Prof. Falken Avatar asked Oct 25 '22 15:10

Prof. Falken


1 Answers

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
like image 105
Joey Adams Avatar answered Oct 29 '22 17:10

Joey Adams