Skip to content

0xCyberGenji/x86-assembly-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Basic Calculator in X86 Linux Assembly


Welcome to my simple calculator project!

It is a calculator that can only perform "addition", "subtraction", "multiplication" operations. Division operation is not in this project but I am trying to add it.

USAGE

Its use is simple as you can see above. You just select an operator and enter 2 digits.

Operators that need to be entered must be '+', '-', '*'.

Creating Object File and Running Assembly Project

You can follow the steps below to compile the project:

To get an Object file:

nasm -f elf64 calc.asm

To create an executable

ld -o calc calc.o

And now just run:

./calc

You should also have the macros.inc file in the same location.

Project algorithm

I wanted to add the algorithm I created in the project here, in case anyone would like to examine the codes. Here is the algorithm:

Project Algorithm


I developed the project according to this algorithm. First, an operator input is taken from the user and operations are performed by jumping to different tags according to the selected operator.

Finally, by going to the label named '_printResult', the result of the operation is displayed and the program is terminated.

If an operator other than the operator specified in the program is entered, an error message is printed on the screen and the program is terminated directly.

About

Basic Calculator with x86 Linux Assembly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published