Skip to content

PaquitoelChocolatero/Assembly-for-beginners

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assembly for Beginners

HitCount
In this repository you will find a beginner's guide to MIPS programming

Every example used can be run so you can see what the output is.

Getting Started

A ssembly files use the ".s" extension

The structure is the following:
tag , dest , rs1 , rs2

Where 'tag' is the desired instruction (add, li, move, etc.), 'dest' is the register where the result of the instruction (if it has one) goes and 'rs1' and 'rs2' are the two registers involving the operation

Compiling with QTSpim

We recommend QtSpim:

alt text
From the top you can find in orange the reset and open option. It is very important that before every compilation you restore the registers and data.
In blue there are the play, pause and stop controls, used to run the program. Followed by the step by step control (in yellow) which will be very useful when debugging.
At the bottom in green are the registers of our processor, they will be filled with whatever you load them with.
And last but not least, in red, the instructions. This is a visual way to know the current instruction, it is very useful with the step by step control in case the program isn't working or has a bug.

Compiling with Mars

You can also use MARS. In order to execute it:

java Mars

alt text

In Mars you can write your code in de Edit Window, or load your '.s' file, clicking on File>Open and looking for your file. For compiling it click on Run>Assemble or use the shortcut F3. Then you will enter on the Execute window, where you can run it completely or step by step, with the green play button placed in the top.

Index of contents:

  1. Guides
  2. MIPS 101
  3. Examples

Credits:

Releases

No releases published

Packages

No packages published