- Loading...
...
Assembly and Dissassembly are reflexive operations. You can feed one tool into another to achieve the same file. For example
java -jar asmtools.jar jdec foo.class > foo.jcod # produces foo.jcod
java -jar asmtools.jar jcod foo.jcod jcod # produces foo.class
For a given class foo.class, the product of dissassembly, and re-assembly is the same foo.class.
...
$ java -jar asmtools.jar jasm [options] filename.jasm
or
$ java -cp asmtools.jar com.sun.asmtools.jasm.Main [options] filename.jasm
option | description |
---|---|
-version | Print jasm tool version |
-d destdir | Specifies a directory to place resulting .class files. If a destdir is not provided, the .class file will be written in the current directory. |
-g | Add debug information to .class file |
...
-nowrite | Do not write resulting .class files. This option may be used to verify the integrity of your source jasm file |
...
-strict | Consider warnings as errors. |
-nowarn | Do not print warnings. |
-cv major.minor | Set the operating class file version (by default 45.3). |
Note - If the optional class attribute 'version' defines (in source of class) the class file version, then it overrides default class file version set by -cv option. |
...
$ java -jar asmtools.jar jdis [options] filename.class
or
$ java -cp asmtools.jar com.sun.asmtools.jdis.Main [options] filename.class
option | description |
---|---|
-version | Print jdis tool version |
...
-g | Generate a detailed output format. Constants from constant pool are printed, and instructions in methods are preceded with source line numbers (if attribute LineNumberTable is available) and with bytecode program counters. |
-s1 | Generate source lines in comments. Commented lines of the source file, from which given .class file is obtained, are printed above the corresponding instruction. Both attributes LineNumberTable and SourceFile must be available. The source file should be placed in the current working directory. |
-hx | Generate floating-point constants in hexadecimal format. |
To use jdis, specify a filename.class
that you wish to disassemble.
You may redirect standard output to a filename .jasm
file. Jdis will disassemble a .class
file and create a resultant .jasm
source file.
Refer to Appendix A (Jasm Syntax) documentation for information on the structure of the resultant .jasm
file.
...
jcoder is a low-level assembler that accepts text based on the Jcoder Jcod 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.
$ java -jar asmtools.jar jcod jcoder [options] filename.jcod
or
$ java -cp asmtools.jar com.sun.asmtools.jcodjcoder.Main [options] filename.jcod
option | description |
---|---|
-version |
...
jcoder tool version | |
-d destdir | Specifies a directory to place resulting .class files. If a destdir is not provided, the .class file will be written in the current directory. |
-nowrite | Do not write resulting .class files. This option may be used to verify the integrity of your source jcod file. |
To use jcod, specify the filename.jcod
file you wish to develop a .class
file from.
...
$ java -jar asmtools.jar jdec [options] filename.class [> filename.jcod]
or
$ java -cp asmtools.jar com.sun.asmtools.jdec.Main [options] filename.class [> filename.jcod]
option | description |
---|---|
-version | Print jdec tool version |
...
-g | Generate a detailed output format. |
To use jdec, specify a filename.class
that you wish to disassemble.
You may redirect standard output to a filename.jcod
file. jdec will disassemble .class
file and create a resultant .jcod
plain source file.
...
$ java -jar asmtools.jar jcdec [options] filename.exp | filename.cap [> filename.jcod]
or
$ java -cp asmtools.jar com.sun.asmtools.jcdec.Main [options] filename.exp | filename.cap [> filename.jcod]
option | description |
---|---|
-version | Print jcdec tool version |
...
-g | Generate a detailed output format. |
To use jcdec, specify a filename.exp
or filename.cap
that you wish to disassemble.
You may redirect standard output to a filename.jcod
file. jcdec will disassemble the file and create a resultant .jcod
plain source file.
...