- Overview
- Key Features
- Repository Structure
- Program Descriptions
- Sample Outputs
- Learning Path
- Technical Skills Demonstrated
- Usage Instructions
- Why This Project Matters
- Performance Considerations
- Author
- Contributing
- License
This repository contains a comprehensive collection of MIPS assembly language programs developed to demonstrate proficiency in low-level programming, computer architecture concepts, and algorithm implementation. The programs range from basic arithmetic operations to more complex applications like grade calculation and graphical pattern generation.
- Clean, well-commented code for readability and maintenance
- Modular design with proper procedure calls and register management
- Comprehensive error handling for robust program execution
- User-friendly interfaces with clear instructions and feedback
- Efficient algorithms implemented at the assembly level
MIPS_Assembly_Programs/
βββ calculators/
β βββ arithematic_ops.asm
β βββ calculator.asm
β βββ combination_calculator.asm
β βββ tax_calculator.asm
βββ education/
β βββ grade_calculator.asm
βββ graphics/
β βββ diamond_pattern.asm
βββ math/
βββ average.asm
βββ fibonacci.asm
Arithmetic Operations (arithematic_ops.asm
)
- Basic calculator supporting addition, subtraction, multiplication, and division
- Includes division-by-zero error handling
- Demonstrates fundamental arithmetic operations in MIPS
Advanced Calculator (calculator.asm
)
- Multi-operand calculator with menu-based interface
- Supports operations on variable number of operands (2-10)
- Uses floating-point operations for precise calculations
- Implements comprehensive input validation and error handling
Combination Calculator (combination_calculator.asm
)
- Calculates mathematical combinations (nCr)
- Uses factorial calculations and optimizations for special cases
- Demonstrates advanced mathematical algorithm implementation
Tax Calculator (tax_calculator.asm
)
- Progressive tax calculation system with multiple tax brackets
- Uses floating-point arithmetic for precise tax calculations
- Implements conditional branching for tax bracket determination
Grade Calculator (grade_calculator.asm
)
- Calculates student grades based on midterm and final exam scores
- Supports multiple subjects with array-based storage
- Converts numerical scores to letter grades and CGPA
- Demonstrates array manipulation and data aggregation
Diamond Pattern Generator (diamond_pattern.asm
)
- Generates customizable ASCII art diamond patterns
- Implements dynamic space and star placement algorithms
- Demonstrates nested loops and pattern generation techniques
Average Calculator (average.asm
)
- Calculates the average of a dynamic set of numbers
- Handles array storage and processing
- Converts integer results to floating-point for precise averages
Fibonacci Sequence Generator (fibonacci.asm
)
- Generates and displays Fibonacci sequences of user-specified length
- Implements efficient algorithm for sequence generation
- Handles special cases for small sequence lengths
When running the basic calculator (arithematic_ops.asm
), you'll see:
- Prompts for two numbers
- Calculated result with appropriate formatting
- Error message for division by zero when applicable
----- Arithmetic Calculator -----
Please Enter First Number: 2
Please Enter Second Number: 6
Addition: 8
Subtraction: -4
Multiplication: 12
Division: 0
Do you want to continue? (1 for yes, 0 for no): 0
-- program is finished running --
The grade calculator (grade_calculator.asm
) produces:
- Summary of entered scores
- Calculated average for each subject
- Letter grade conversion
- Overall CGPA calculation
===== Student Grade Calculator =====
Please enter the midterm marks out of 40:
Subject #1 marks: 37
Subject #2 marks: 38
Subject #3 marks: 33
Subject #4 marks: 39
Subject #5 marks: 40
Please enter the final marks out of 60:
Subject #1 marks: 55
Subject #2 marks: 59
Subject #3 marks: 57
Subject #4 marks: 58
Subject #5 marks: 60
===== Results =====
Total marks: 476
CGPA: 4.0
Grade: A
Excellent
Do you want to calculate another grade? (1 for Yes, 0 for No): 0
-- program is finished running --
The diamond pattern generator (diamond_pattern.asm
) creates customizable ASCII art:
- User-defined diamond size
- Precisely centered pattern
- Clean, symmetrical output
Enter diamond size (even number between 2-20, 0 to exit): 20
*
***
*****
*******
*********
***********
*************
***************
*****************
*******************
*********************
*******************
*****************
***************
*************
***********
*********
*******
*****
***
*
Enter diamond size (even number between 2-20, 0 to exit): 0
-- program is finished running --
The Fibonacci program (fibonacci.asm
) displays:
- Sequence up to user-specified length
- Properly formatted number series
- Special handling for first terms
====== FIBONACCI SEQUENCE ======
Enter 0 or a negative number to exit the program.
Please enter the value of n (how many Fibonacci numbers to display): 14
Fibonacci Sequence (first 14 numbers):
0 1 1 2 3 5 8 13 21 34 55 89 144 233
For those new to MIPS assembly, consider following this progression:
- Start with
arithematic_ops.asm
to understand basic operations - Move to
average.asm
to learn array manipulation - Try
diamond_pattern.asm
for loop structures - Progress to more complex programs like
grade_calculator.asm
- Low-level programming concepts and practices
- Memory management using MIPS registers and memory allocation
- Floating-point operations for precise calculations
- Array manipulation and dynamic memory usage
- Subroutine implementation with proper stack management
- Input validation and error handling
- Bitwise operations and register manipulation
- Algorithm implementation at the assembly level
- MIPS simulator such as MARS, SPIM, or QtSPIM
- Basic understanding of MIPS assembly language
- Open your preferred MIPS simulator
- Load the desired
.asm
file - Assemble and run the program
- Follow on-screen instructions for program interaction
Example:
# To run the Fibonacci program using SPIM
spim -file math/fibonacci.asm
This collection demonstrates proficiency in low-level programming and computer architecture concepts, essential skills for roles in:
- Embedded systems development
- System-level programming
- Compiler design
- Performance optimization
- Computer architecture research
- Operating systems development
The ability to work effectively with assembly language shows a deep understanding of how computers function at the hardware level, a valuable skill set for any software engineering role requiring performance optimization or system-level work.
These programs were designed with efficiency in mind, demonstrating:
- Optimal register usage to minimize memory access
- Efficient loop structures
- Proper branch prediction considerations
- Minimal instruction count for core operations
Developed by a passionate software engineer with interests in low-level programming, computer architecture, and efficient algorithm implementation.
Contributions to this MIPS Assembly collection are welcome! Here's how you can contribute:
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature
) - Make your changes
- Use clear, descriptive labels for all procedures
- Include comprehensive comments explaining register usage
- Follow the existing formatting style (indentation, spacing)
- Document all procedures with input/output specifications
- Update the README.md with details of your program
- Add sample outputs where applicable
- Explain the purpose and functionality of your code
- Commit your changes (
git commit -m 'Add feature: description'
) - Push to your branch (
git push origin feature/your-feature
) - Open a Pull Request with detailed description
- New MIPS assembly programs
- Optimizations to existing programs
- Documentation improvements
- Bug fixes and error handling enhancements
This project is available for educational and reference purposes. Feel free to explore, modify, and learn from these examples.
"Programming at the assembly level isn't just about performance; it's about understanding the foundation upon which all higher-level code runs."