Calculator in Assembly
this is a basic calculator written in assembly, it has some nice features, it was developed for the laboratory of the Computer Architecture course of the Computer Science Engineering on the USAC (so it is an useful tool for learning purposes)
- Written fully in assembly, no external library for input/output, just interruptions.
- Internally use a 128 bit representation for holding operators and result. The requirement was operate (+,-) with numbers up to 20 digits, and (*,/) with numbers up to 10 digits.
- Multiplication using repeated addition operations instead of the native “mult”.
- Divide by repeated subtraction and counting instead of the native “div”.
- Convert an ASCII String to Binary Number and vice versa. this is required to handle user input, and to display results.
- Basic Input/Output functions, like GetCh, PutCh, NewLine, WriteLine
- Custom Input/Output functions to read and write 128bit numbers, like Read128BitNum, Write128BitNum
- Basic Menu in Text Mode.
- Easy to modify, build. The package include the assembler and linker so the executable can be created anytime. (using DOSBox if you are running on a modern operating system)
For Example, in this image sequence, we can see a simple addition.
And for large numbers (123456789 + 987654321)