Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For a given class foo.class, the product of dissassembly, and re-assembly is the same foo.class.

 

...

Jasm vs.

...

Jcod

Which format to use depends on the task you are trying to do. We can describe some generalizations of when you might wish to use the JASM format versus the JCOD format.  

...

Jasm

The biggest difference between the two formats is that JASM specifically focuses on representing byte-code instructions in the VM format (while providing minimal description of the structure of  the rest of the class file).  Generally, JASM is more convenient for semantic changes, like change to instruction flow.

...

Jcod

JCOD provides good support for describing the structure of a class file (as well as writing incorrect bytes outside of this structure), and provides no support for specifying byte-code instructions (simply raw bytes for instructions).   JCOD is typically used for VMs to test Well-formedness of class files (eg extra or missing bytes), boundary issues, constant-pool coherence, constant-pool index coherence, attribute well-formedness, etc..

...

Note - See the following sections for the options associated with each tool.

...

 

...

Jasm

jasm is an assembler that accepts a text file based on the JASM Specification, and produces a .class file for use with a Java Virtual Machine.

...

To use jasm, specify the filename of the .jasm file you wish to develop a .class file from. The Jasm Specification contains information relative to the format of a .jasm file.

 

...

Jdis

jdis is a disassembler that accepts a .class file, and prints the plain-text translation of jasm source file to the standard output.

...

Refer to the Jasm Assembler documentation for information on the structure of the resultant .jasm file.

 

...

Jcod

jcod is a low-level assembler that accepts text based on the Jcoder Specification. and produces a .class file for use with a Java Virtual Machine. Jcod's primary use is as a tool for producing specialized tests for testing a JVM implementation.

...

To use jcod, specify the filename.jcod file you wish to develop a .class file from. The Jcod Specification contains information relative to the format of a .jcod file.

 

...

Jdec

jdec is a low-level disassembler that accepts .class file and prints a plain text of jcod source file to the standard output.

...

Refer to the Jcod Low-Level Assembler documentation for information on the structure of the resultant .jcod file.

 

...

Jcdec

jcdec is a low-level disassembler that accepts .class file and prints a plain text of jcod source file to the standard output.

...