Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What JVM assemblers are there? [closed]

Tags:

java

assembly

jvm

I want a JVM assembler that is straightforward and simple. It should take a text file written in the mnemonic language described in The Java Virtual Machine Specification and produce class files, i.e. bytecode.

To be clear: I don't want a library that can generate class files from invocations of an API.

What are the current statuses of the JVM assemblers? Do they support invokedynamic (not mandatory to me, but an advantage)? On what operative system can I use them? What are their individual pros and cons?

like image 537
Staffan Nöteberg Avatar asked May 30 '11 13:05

Staffan Nöteberg


2 Answers

Some time has passed, and now there is an alternative to Jasmin called Krakatau.

From the README.txt:

The Krakatau assembler is intended as a replacement for Jasmin, and was originally written due to the limitations of Jasmin. It is mostly backwards compatible with Jasmin's syntax, though not necessarily with the extensions introduced in JasminXT. However, Krakatau offers many new features, most importantly the ability to directly specify constant pool references.

At this time, it seems that Krakatau was last updated a month ago, and Jasmin was last updated nine years ago.

Krakatau does support invokedynamic and utilizes the same instruction names as are used in the JVMS.

Krakatau is implemented in Python. Personally, I like my Java tools to be implemented in Java, but given the nature of this tool (constructing class files from non-Java source) and the lack of competition in this niche, I'll give it a chance.

like image 76
daveloyall Avatar answered Oct 03 '22 20:10

daveloyall


Jasmin is the de facto standard. Recent versions support invokedynamic. It's written in Java, so it's portable.

like image 40
gustafc Avatar answered Oct 03 '22 19:10

gustafc