Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

🧮 MIPS-Based Calculator

This is a menu-driven calculator developed in MIPS Assembly Language that supports both integer and floating-point arithmetic operations. It provides an intuitive command-line interface with error handling and user-friendly prompts.


📋 Features

✅ Supported Integer Operations

  • + Addition
  • - Subtraction
  • * Multiplication
  • / Division (with zero division error handling)
  • ^ Exponentiation (limit: exponent ≤ 15)
  • % Modulus (with zero division error handling)
  • ! Factorial (limit: ≤ 12, no negatives allowed)

✅ Supported Floating Point Operations

  • + Addition
  • - Subtraction
  • * Multiplication
  • / Division (with zero division error handling)

🔁 Other Functionalities

  • m → Go back to the Number Type Menu
  • q → Quit the calculator gracefully with a message

🧩 Enhanced User Experience (UX)

To improve the clarity and structure of the UI, a separator line (-----------------------------------------------------------) is used throughout the interface. This separator:

  • Clearly distinguishes between input sections, results, and menus
  • Creates a clean and organized view
  • Makes it easier for users to follow the flow of operations

🚀 How to Run

🔧 Prerequisites

  • MIPS Emulator like:
    • SPIM (QtSPIM recommended)
    • MARS (Not preferred for some syscalls, better with QtSPIM)

📦 Files

Make sure all the following files are present:

  • calculator.asm
  • README.md

▶️ Steps to Run

  1. Open QtSPIM.
  2. Load the calculator.asm file.
  3. Click on Run (F5 or Run button).
  4. Follow on-screen prompts to perform operations.

💡 Sample Usage Flow

Welcome to MIPS-Based Calculator

-----------------------------------------------------------

On which of the following do you want to perform operations.
i [Integers]
f [Floating Numbers]

User input → i

Enter Operator for performing corresponding operation for integers:

+ [Addition]
- [Subtraction]
...
q [Quit]

User input → +

Enter the first argument.
10
Enter the second argument.
20
The sum is 30

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages