Skip to content

DASHMIPS_DOWNLOAD

Joshua Mitchener edited this page Oct 15, 2020 · 10 revisions

DASHMIPS DOWNLOAD INSTRUCTIONS

Step 1: Downloading Python3 and Dashmips

Prerequisites

The Dashmips module is tested and developed with python 3.8+.

Linux

We recommend using a python version manager on these OSes to easily manage your python environment. Pyenv works particularly well, follow the instructions at the link. Once pyenv is installed find your os in this list and run the commands provided. Then install the latest version of python by running pyenv install VERSION where 'VERSION' is 3.8.0 or later.

MacOS

Go to the official python site for MacOS releases. Grab the latest version of the "macOS 64-bit installer" and run it.

Windows

Go to the official python site for windows releases. Grab the latest version of the "Windows x86-64 executable installer" and run it.

Installing

Once you have python installed correctly you should be able to run it from a terminal.

MacOS users can find the terminal in the Utilities folder in their system's Applications folder. (Search 'terminal' with spotlight Cmd+Space). Windows users can use cmd or powershell found in Windows System or Windows Powershell in the Start Menu. (Search 'cmd' or 'powershell' Win+Q)

Test the following commands to confirm:

python --version pip --version

If the python version is correct and pip also prints a version we can install / upgrade dashmips:

pip install --upgrade dashmips

FIXME: WINDOWS HOW TO SET PATH CORRECTLY

Getting Started

Here's your obligatory hello world, give it a whirl! Save the following code to a plain text file named "hello.mips". (The extension is not required to be .mips but you will notice the documentation uses the .mips extension in later examples.)

.data
hello_str: .asciiz "Hello, World!\n"

.text
main:
    li      $v0, 4          # 4 is the syscall to print_str
    la      $a0, hello_str  # Load string address into $a0
    syscall

    li      $a0, 0          # set exit code
    li      $v0, 10         # 10 is the syscall to exit
    syscall

Now in your terminal you can run the command:

dashmips run hello.mips And of course you can expect:

'Hello, World!'

Step 2: Downloading Visual Studio Code (vscode)

For Windows users

  1. Go to https://code.visualstudio.com/download.

  2. Download the appropriate zip file for Windows on the left (the download should start automatically).

  3. When asked to allow this app to make changes, select 'Yes'.

  4. When the setup window appears, click next and accept the license agreement.

  5. Choose where you would like Visual Studio Code to be installed.

  6. Click 'Install', then click 'Finish' when the download is completed.

For Linux users

  1. Click the home button in the bottom left corner.

  2. Select 'Software.'

  3. Search for 'Visual Studio Code' in the search bar.

  4. Click on Visual Studio Code and click the blue 'Install' button.

  5. Type in your computer's password to allow Visual Studio Code to be installed.

  6. Once the download is complete, select the blue 'Launch' button.

For MacOS users

  1. Go to https://code.visualstudio.com/download.

  2. Download the appropriate zip file for Mac OS on the right (the download should start automatically).

  3. Unzip the zip file.

  4. The application should now be available in the same directory as the zip file.

  5. Double click the application to open Visual Studio Code.

  6. You should be prompted with: '"Visual Studio Code” is an app downloaded from the Internet. Are you sure you want to open it?' Click 'Open'.

Step 3: Running Mips Files through Dashmips

  1. In vscode, click on 'Open Folder' and navigate to the folder you want to use (not the file!) and click ok.

  2. You should see the list of files in the folder you opened listed on the left, and you can click on them to see their contents.

  3. Now, click on the 5th symbol on the left (should look like four boxes with the top right detached) labeled extensions.

  4. You should be prompted to 'Search Extensions in Marketplace'. Type in Dashmips and you should see dashmips-debugger appear.

  5. Select dashmips-debugger and click install.

  6. Click on the 4th symbol of the left above extensions titled run.

  7. Click 'create launch.json file' for Dashmips and the file should be automatically generated.

  8. Open and view the file that you want to debug.

![Play Button Image] (https://github.com/nbbeeken/dashmips/wiki/images/play_button.png) 9. Use the green play button on the top left to run and debug your Mips files (should be labeled with 'Dashmips: (Run)').

dashmips icon
Clone this wiki locally