Releases: anvitha305/legv8sim
v2.0 The Simulator!
This is the legv8 assembly simulator for ECE 331 at UMass Amherst.
Minimum Requirements
Python 3 [the script installs the remaining requisite libraries] Use Homebrew to install Python3 if you are on MacOS.
Rust and Cargo [Rust's package manager. Install via rustlang website]
In order to install the simulator and use it, use the Source code option to download the directory needed to build the application on your computer.
Once you unzip the source and navigate to its inner folder, run the following command with your terminal:
sh run.sh
This will install the requirements for the simulator and run PyInstaller to create an executable.
Once the script is finished, you can run the application file in the dist folder within this inner folder [i.e. app.exe
for Windows, app.app
for MacOS], and this will let you run the application.
You can open files with the Open File option, and select a file with .s or .legv8 with valid LEGV8 assembly to run it. You can step or reset, and all the text entry fields let you add values for memory or registers in the respective views. Errors show up in the errors section on the simulator and deeper errors with the program go in the logfile that is in the dist directory after the app runs. You must hit return to confirm your edits to any registers or memory.
Note that you need to enter arrays in manually for running code on arrays, with addressing done manually. A config file system is planned for next release.
Error Reporting
You can open an Issue on GitHub here and add screenshots of the simulator and logfiles or contact me at aramachandra[at]umass[dot]edu with this information if there's a deeper error with your code running with the simulator.
v1.3 Syntax Highlighting for Nano
Guess what? Another editor plugin drafted 💀. I know I said Emacs would be the last one but I would rather use Nano than it personally so I decided to put Emacs at the end as the last ditch resort.
To install this plugin, download the legv8.nanorc
file put it in your /usr/share/nano
folder or C:\nano\
in Windows or /usr/local/share/nano
on MacOS and add the following to your .nanorc
file, replacing with where the file's location is:
include "<PATH TO FILE>/legv8.nanorc'
Like in v1.1 [Vim Syntax Highlighting], this may have conflicts with .s
filetypes, so when editing LEGV8 assembly files with .s
as the extension you should use the command line option --syntax=legv8
when opening Nano so that the highlighting from asm.nanorc
isn't used instead. It automatically uses the highlighting for .legv8
filetypes when the .nanorc
file is configured as above, but this should resolve conflicts with other assembly files when deciding on a type of syntax highlighting.
v1.2 Syntax Highlighting for VSCode
The natural next step for legv8sim as a project was to develop a VSCode Extension for LEG-V8 assembly. Note that if you write assembly with a .s filetype your existing highlighting rules may be overwritten with this one and you should disable this extension when you write non-LEGV8 assembly.
Extension Installation
Extension Marketplace Website
Go to the VSCode Extension Marketplace website to download the extension for VSCode.
Extension Marketplace in VSCode
Go to the 'Extensions' section in VSCode or use shortcut <Ctrl><Shift>X
. Search"legv8-vscode" to install the extension.
Manual (.vsix) Installation
Download the legv8-vscode-0.0.1.vsix
file and use vsce to add the extension manually. Using the Install from VSIX command in the Extensions view command dropdown, or the Extensions: Install from VSIX command in the Command Palette, point to the .vsix
file.
You can also use the following command in the directory that the .vsix
file is in:
code --install-extension legv8-vscode-0.0.1.vsix
v1.1 Syntax Highlighting Plugin for Vim
As stated in v1.0, the goal is to make LEGV8 development editor agnostic to give more freedom to students developing for the purposes of running on the simulator. As many know, I love Vim and I wrote this plugin because I loved writing my LEGV8 code in Vim 🥰.
Note that if you write assembly with a .s filetype your existing highlighting rules may be overwritten with this one and you should disable this plugin when you write non-LEGV8 assembly.
Plugin Installation
- Add
Plug 'anvitha305/legv8sim', {'branch': 'legv8-vim'}
to your vimrc file. - Reload your vimrc or restart
- Run
:PlugInstall
- Add
Plugin 'anvitha305/legv8sim
to your vimrc file. - Reload your vimrc or restart
- Run
:BundleInstall
- This gives you the main repo but you would run the following to get the actual Vim plugin:
cd ~/.vim/bundle/legv8sim
git checkout legv8-vim
- Replace
Plugin 'anvitha305/legv8sim
withPlugin 'anvitha305/legv8sim', {'pinned': 1}
so next time you update things it doesn't make you go through this but you would have to manuallygit pull
to update the plugin
- Add
NeoBundle 'anvitha305/legv8sim', 'legv8-vim'
to your vimrc file. - Reload your vimrc or restart
- Run
:NeoUpdate
cd ~/.vim/bundle
git clone -b legv8-vim --single-branch https://github.com/anvitha305/legv8sim.git
v1.0 Syntax Highlighting for Sublime
In order to parse the LEG-V8 assembly for the simulator, I will be using the Rust library Syntect, which parses based on .sublime-syntax files. I decided to release syntax highlighting for Sublime Text 3 as a package. In a future release, I will be porting the syntax highlighting for instructions from the LEG-V8 Green Card into Vim, VSCode and Emacs as well to facilitate in-class LEG-V8 development in students' editor of choice.
To get the syntax highlighting in Sublime, download the legv8.sublime-package file and put it in your Packages folder for LEG-V8 highlighting in .s and .legv8 files.