🇬🇧 English | 🇷🇺 Русский
A simple calculator written in 16-bit x86 Assembly running directly on BIOS.
The project contains a custom bootloader and a small kernel that performs arithmetic operations without using any operating system.
- Integer addition
- Integer subtraction
- Integer multiplication
- Integer division
- Signed 16-bit integer support
- Colored VGA text output
- Input validation
- Backspace support
- Overflow detection
- Division-by-zero handling
- Invalid operation handling
- Custom bootloader
- Modular kernel structure
- BIOS keyboard input
- BIOS text output
- 16-bit Real Mode
- NASM syntax
- NASM
- QEMU
- x86 emulator or real hardware with BIOS support
makeManual build:
nasm -f bin src/boot/boot.asm -o bin/boot.bin
nasm -f bin src/kernel/main.asm -o bin/kernel.binCreate disk image:
cat bin/boot.bin bin/kernel.bin > bin/disk.imgUsing QEMU:
qemu-system-i386 -drive format=raw,file=bin/disk.imgThe calculator starts from a custom bootloader and runs in 16-bit Real Mode.
No operating system is required.
The project uses BIOS interrupts:
INT 10h (0x10)— video services for text outputINT 16h (0x16)— keyboard input
The kernel implements:
- string input
- string-to-integer conversion
- integer-to-string conversion
- arithmetic operations
- result printing
- Supports only signed 16-bit integers (-32768..32767)
- BIOS systems only
- Floating-point arithmetic is not supported
.
├── src/
│ ├── boot/
│ │ └── boot.asm
│ └── kernel/
│ ├── color.asm
│ ├── data.asm
│ ├── io.asm
│ ├── math.asm
│ └── main.asm
├── bin/
│ ├── boot.bin
│ ├── kernel.bin
│ └── disk.img
├── docs/
│ └── cat.gif
├── Makefile
├── LICENSE
├── README.md
└── README_RU.md
The kernel is loaded by the custom bootloader at address 0x7E00.
The project is split into the following modules:
boot.asm— bootloadermain.asm— kernel entry pointio.asm— keyboard input and text outputmath.asm— arithmetic and number conversioncolor.asm— VGA color managementdata.asm— strings, buffers and global variables
This project is a low-level x86 Assembly experiment focused on BIOS programming and operating system independent execution.
The goal was to practice:
- 16-bit x86 Assembly
- BIOS interrupts
- Real Mode programming
- Bootloader development
- Low-level input/output
- Memory layout and binary loading
- Calculator on libc (System V ABI) - 🔗 asm-calc-libc
- Calculator using raw syscalls (no libc) - 🔗 asm-calc-syscall
- 16-bit BIOS calculator with custom bootloader - 🔗 asm-calc-bios
MIT

