https://github.com/moulahguine/mips-student-projects
Project showing a C codebase and its manual translation to MIPS assembly instructions
https://github.com/moulahguine/mips-student-projects
c code-conversion cprogramming homework-assignments mips
Last synced: 19 days ago
JSON representation
Project showing a C codebase and its manual translation to MIPS assembly instructions
- Host: GitHub
- URL: https://github.com/moulahguine/mips-student-projects
- Owner: moulahguine
- Created: 2025-04-30T09:56:02.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-30T10:47:36.000Z (about 1 year ago)
- Last Synced: 2025-04-30T11:25:22.714Z (about 1 year ago)
- Topics: c, code-conversion, cprogramming, homework-assignments, mips
- Language: Assembly
- Homepage:
- Size: 221 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MIPS Assembly Practice – Student Projects
This repository contains four beginner-level MIPS assembly programs written and tested using the [MARS simulator](http://courses.missouristate.edu/KenVollmar/MARS/). These programs are based on basic C code exercises (conditionals, loops, arrays) and rewritten step-by-step in MIPS to help understand how low-level logic works
---
## My Homework
### Original C Code

### Converted MIPS Code
---
## Overview
Each file in this project is a simple translation of a small C program into MIPS. No macros, no shortcuts — just basic student-style code using core instructions and syscalls.
| File Name | Description |
|----------------------|---------------------------------------------|
| `q1_compare.asm` | Compare two integers and apply conditions |
| `q2_even_numbers.asm`| Print even numbers from 0 to 9 |
| `q3_array_double.asm`| Print double the value of each array element|
| `q4_array_add.asm` | Add two arrays and print the result |
---
## How to Run
You can run these files in the **MARS MIPS Simulator**:
1. Download [MARS.jar](http://courses.missouristate.edu/KenVollmar/MARS/)
2. Open the `.asm` file
3. Assemble (`F3`)
4. Run (`F5`) and enter input if needed
---
## Screenshots
### Running `q1_compare.asm`

### Running `q2_even_numbers.asm`

### Running `q3_array_double.asm`

### Running `q4_array_add.asm`

---
## What I Learned
- Using `syscall` for input/output
- Comparing values with `bgt`, `ble`, `beq`
- Looping with `addi`, `slt`, and labels
- Working with arrays in memory (`la`, `lw`, `sw`)
- Keeping code clean and readable
---