- Loading...
...
This chapter describes general principles and techniques for using the AsmTools. For detailed information about the syntax of each component and command line examples, see Appendix B. If no command-line options are provided or they are invalid, the tools provide error messages and usage information. To get the help message, launch AsmTools without any parameters as follows:
...
The help system describes how to use all of the AsmTools components and contains the following topics described in this chapter.
Table of Contents | ||||
---|---|---|---|---|
|
...
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 # produces foo.jcod
java -jar asmtools.jar jcod foo.jcod # produces foo.class
For a given class foo.class, the product of dissassembly, and re-assembly is the same foo.class.
...
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.
...
...
Asmtools consist of five utilities:
...
Note - See the following sections for the options associated with each tool. |
...
...
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 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.
...
jcoder 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. JcoderJcod's primary use is as a tool for producing specialized tests for testing a JVM implementation.
$ java -jar asmtools.jar jcoder jcod [options] filename.jcod
or
$ java -cp asmtools.jar com.sun.asmtools.jcoderjcod.Main [options] filename.jcod
-version Print jcoder jcod 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 jcoder jcod file.
To use jcoderjcod, specify the filename.jcod
file you wish to develop a .class
file from. The Jcoder Jcod Specification contains information relative to the format of a .jcod
file.
...
jdec is a low-level disassembler that accepts .class
file and prints a plain text of jcod
source file to the standard output.
...
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.
Refer to the Jcoder Jcod Low-Level Assembler documentation for information on the structure of the resultant .jcod
file.
...
jcdec is a low-level disassembler that accepts .class
file and prints a plain text of jcod
source file to the standard output.
...
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.
Refer to the Jcoder Jcod Low-Level Assembler documentation for information on the structure of the resultant .jcod
file.
...