Skip to content

SDobyS/asm-calc-syscall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASM Syscall Calculator

🇬🇧 English | 🇷🇺 Русский

A simple command-line calculator written in x86-64 Assembly using raw Linux system calls (without libc).

Features

  • Integer addition
  • Integer subtraction
  • Integer multiplication
  • Integer division
  • Division-by-zero handling
  • Invalid operation handling
  • Manual string-to-integer conversion
  • Manual integer-to-string conversion
  • Raw Linux syscalls (read, write, exit)
  • No libc dependency
  • ANSI color support for UI elements
  • Screen clearing on startup
  • Exit on 'q' input at any prompt
  • NASM syntax

Requirements

  • Linux
  • NASM
  • GNU LD
  • GNU Make

Build

make

Manual build:

nasm -f elf64 src/main.asm -o bin/obj/main.o
ld bin/obj/main.o -o bin/out/calculator

Run

make run

or

./bin/out/calculator

Example

Project Structure

.
├── src/
│   └── main.asm
├── notes/
├── bin/
├── Makefile
├── LICENSE
└── README.md

About

This is my first calculator written entirely with raw Linux system calls.

The project was created to practice x86-64 Assembly, Linux syscalls, manual input/output handling, string parsing, and integer formatting without using the C standard library.

Roadmap

License

MIT