Welcome to the Scientific Calculator! This project implements a modular and efficient scientific calculator in x86 Assembly language, capable of performing both basic arithmetic and advanced scientific calculations.
This Scientific Calculator was developed as part of a third-semester project for the course "Computer Organization and Assembly Language" at FAST NUCES Karachi. The project demonstrates essential assembly language programming concepts using MASM and Irvine32.lib and covers both standard and advanced mathematical operations.
- Basic Arithmetic: Addition, Subtraction, Multiplication, and Division
- Advanced Calculations: Includes Trigonometric (sine, cosine, tangent), Logarithmic, and Exponential functions
- Modular Design: Each calculation type is handled by a dedicated procedure for clarity and reusability
- Frontend Implementation: A C++ frontend file interacts with the backend assembly file to handle user input and display results.
To compile and run the Scientific Calculator application, follow these steps:
Ensure you have the following installed on your system:
- MASM (Microsoft Macro Assembler)
- Irvine32 library (usually provided with the textbook or source you are using for Assembly language)
- C++ compiler (such as MinGW or Visual Studio)
-
Clone the repository:
git clone https://github.com/FAST-Dev-Team-Semester-Projects/Scientific-Calculator-ASM.git
-
Navigate to the project directory:
cd Scientific-Calculator -
Set up Irvine32 library:
Make sure you have the
irvine32.libfile available. You can download it from Irvine's website or use the version provided with your textbook. Placeirvine32.libin a directory on your system.If the library is located in a different directory, you need to link it when compiling your
.asmfile. For example, if the library is in the directoryC:\Irvine32\lib\, specify the path during the assembly process like this:ml /c /coff Backend.asm link /subsystem:console Backend.obj C:\Irvine32\lib\irvine32.lib
-
Assemble and link the Assembly code:
The project uses a combination of C++ (frontend) and Assembly (backend). The C++ frontend interacts with the assembly backend to handle user input, display results, and perform calculations.
-
Assemble the backend (
Backend.asmfile):ml /c /coff Backend.asm link /subsystem:console Backend.obj C:\Irvine32\lib\irvine32.lib
-
Compile and link the frontend C++ code (
Calculator.cppfile):If you're using a C++ compiler like MinGW, run:
g++ Calculator.cpp -o calculator.exe
This will create the executable for the Scientific Calculator.
-
-
Run the program:
After successful compilation, you can run the program by executing:
calculator.exe
- Irvine32 library: The library contains essential functions for handling input/output, memory, and more, commonly used in MASM-based projects.
- The project consists of two parts:
- Frontend (
Calculator.cpp): Handles user input and output formatting, and interfaces with the assembly backend. - Backend (
Backend.asm): Implements the core mathematical operations and logic.
- Frontend (
- Ensure that the path to the
irvine32.libfile is correctly specified based on where it is located on your system. You can update the path in thelinkcommand accordingly.
- Calculator.asm: Main assembly file with modular procedures for each calculation type.
- Frontend.cpp: The C++ frontend file that interacts with the backend assembly functions. It handles user input and output formatting.
- Procedures:
- Arithmetic Procedures: Handles Addition, Subtraction, Multiplication, Division.
- Trigonometric Procedures: Handles Sine, Cosine, Tangent functions (degree/radian mode).
- Logarithmic and Exponential Procedures: Handles advanced scientific functions.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or feedback, please contact:
- Syed Haider Murtaza at haidermurtaza16@gmail.com
- Muhammad Rayyan at imuhammadrayyan@gmail.com
- Mujtaba Kamran at mujtaba.kamran2004@gmail.com