This document describes how to install the MVaP virtual machine simulator (version 3.2).
Prerequisite: ANTLR must already be installed and the antlr4 command
must be available in your terminal environment.
See: installAntlr.md
Download the archive:
sources-MVaP-3.2.zip
Unzip the archive.
Navigate to the extracted directory:
cd sources-MVaP-3.2Run the following commands:
antlr4 MVaP.g4
javac *.javaOpen the file:
META-INF/MANIFEST.MF
Locate the Class-Path line and specify the full path to your ANTLR JAR
file.
If your ANTLR file is located at:
$HOME/bin/antlr-4.9.2-complete.jar
Modify the line as follows:
Class-Path: $HOME/bin/antlr-4.9.2-complete.jar
Do not use quotation marks.
From inside sources-MVaP-3.2, run:
jar cfm MVaP.jar META-INF/MANIFEST.MF *.classThis creates the file:
MVaP.jar
Move it to your local bin directory:
mv MVaP.jar $HOME/binAdd MVaP to your CLASSPATH. For example, in ~/.bashrc:
export CLASSPATH=.:$HOME/bin/MVaP.jar:$HOME/bin/antlr-4.9.2-complete.jar:$CLASSPATHReload the configuration:
source ~/.bashrcFor a source file containing only MVaP instructions (example:
add.mvap):
java -cp $CLASSPATH MVaPAssembler add.mvapThis generates:
add.mvap.cbap
which is the executable bytecode.
java -jar $HOME/bin/MVaP.jar add.mvap.cbapjava -jar $HOME/bin/MVaP.jar -d add.mvap.cbapTo simplify usage, you may define aliases in your ~/.bashrc:
alias mvapasm='java -cp $CLASSPATH MVaPAssembler'
alias mvaprun='java -jar $HOME/bin/MVaP.jar'You can then use:
mvapasm add.mvap
mvaprun add.mvap.cbap