MicroJava Tools

MJTools

Legal

Links

MJVM - MicroJava Virtual Machine

The MicroJava Virtual Machine (MJVM) is a bytecode interpreter for MicroJava as specified in the MicroJava Specification (pdf document). In this implementation MJVM features GUI front-end and debug capabilities.

MJVM itself is fully implemented in Java and requires Java Runtime Environment to run. It works on Windows, Linux, Solaris, Mac and other Java enabled platforms.

Usage

MJVM can be used from the command line or as a standalone GUI application.

From the command line type:

java -jar mjvm.jar [options] <file>

where [options] are:
  --help, -h  Display help information
  --version   Print program version and exit
  --gui       Start GUI
and <file>:
    MicroJava bytecode file
or, if the provided shell script (mjvm.bar or mjvm.sh) is on the path, type:
mjvm [options] <file>

File mjvm.jar is an executable Java archive that does not depend on other Java libraries. It can also be run as a GUI application (shown in Figure 1). Double click on this file should start the application. This is the preferred way of using MJVM.

Figure 1: MicroJava Virtual Machine

In this GUI mode you can set break points on MJVM instructions and edit the values of the MJVM memories. This is shown in the Figure 2. Memory columns marked with asterisk (*) are editable.

Examples

Examples are provided within the application in the Help/Examples menu. There are three examples: HelloWorld.mjb, ByteEcho.mjb and IntEcho.mjb. The HelloWorld example is a good starting point. It is shown in Figure 2., in debugging mode stopped at instruction bprint on address 27.

Figure 2: MJVM Memory Views