GithubHelp home page GithubHelp logo

refertv / assembly-calculator Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 5 KB

The Simple Calculator project is a demonstration of basic arithmetic operations implemented in x86_64 assembly language. This project serves as an educational resource for those interested in learning about low-level programming and computer architecture.

Assembly 100.00%
assembly calculator calculator-application

assembly-calculator's Introduction

Simple Calculator in x86_64 Assembly Language

Description

This program is a simple calculator written in x86_64 assembly language. It allows performing basic mathematical operations on two integers.

Program Structure

The program consists of three sections: .data, .bss, and .text.

  • The .data section contains text constants used for displaying messages and formatting the result.
  • The .bss section reserves space for three 32-bit integers, which will store the values entered by the user and the result of the operations.
  • The .text section contains the actual program code, including input/output handling and mathematical operations.

Usage Instructions

The program prompts the user for two integers and the operation number to perform (1 - addition, 2 - subtraction, 3 - multiplication, 4 - division). After entering the numbers and the operation number, the program returns the result of the operation.

How to Run

To compile and run the program, follow these steps:

  1. Copy the above source code into a file with a .asm extension.
  2. Compile the code using an assembler, e.g., nasm -f elf64 calculator.asm.
  3. Link the code using the ld linker, e.g., ld -o calculator calculator.o.
  4. Run the program with the command ./calculator.

License

This project is licensed under the MIT License. See the LICENSE file for details.

assembly-calculator's People

Contributors

refertv avatar

Stargazers

John Auta Nyakweba avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.