https://github.com/herenturker/easm
EASM is an educational 2-pass assembler project targeting x86 systems, primarily supporting 16-bit assembly instructions. It serves as a learning tool to understand assembler design, symbol tables, and machine code generation.
https://github.com/herenturker/easm
asm assembler c cpp educational-project open-source x86
Last synced: about 2 months ago
JSON representation
EASM is an educational 2-pass assembler project targeting x86 systems, primarily supporting 16-bit assembly instructions. It serves as a learning tool to understand assembler design, symbol tables, and machine code generation.
- Host: GitHub
- URL: https://github.com/herenturker/easm
- Owner: herenturker
- License: agpl-3.0
- Created: 2025-08-05T18:57:21.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-10-08T15:59:58.000Z (9 months ago)
- Last Synced: 2025-10-08T17:57:56.766Z (9 months ago)
- Topics: asm, assembler, c, cpp, educational-project, open-source, x86
- Language: C
- Homepage:
- Size: 105 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EASM β Eren's Educational 2-Pass Assembler
**EASM** is an educational project that demonstrates the inner workings of a simple **two-pass assembler**.
Itβs designed to help students and hobbyists learn about assembler structure, symbol resolution, and code generation using the GNU toolchain.
> β οΈ Note: This project is educational and work in progress.
---
## π Overview
An assembler translates human-readable assembly language into machine code.
A *two-pass assembler* first scans the source to collect symbols and labels, then generates final machine code in the second pass.
EASM is **not intended as a production assembler**, but as an educational resource for understanding:
- How instruction parsing and tokenization work
- How symbol tables and relocations are handled
- How code is emitted after symbol resolution
---
## π§ Features
- Two-pass parsing and symbol table management
- Basic instruction and directive recognition
- Minimal, clear code aimed at readability and learning
- Written in C/C++ using the GNU toolchain (`gcc`, `g++`)
- Cross-platform build system using `make`
- Compatible with Windows (MSYS2 / MinGW) and Linux
---
## βοΈ Building the Project
Clone the repository and build using GNU Make:
```bash
git clone https://github.com/herenturker/easm.git
cd easm
make
```
This command will compile all source files and produce the executable:
```bash
easm.exe # On Windows
./easm # On Linux
```
## Requirements
You will need:
- GCC (C and C++ compilers)
- GNU Make
- Optionally MSYS2 or MinGW if you are on Windows
To verify installation:
```bash
gcc --version
g++ --version
make --version
```
By default, EASM reads the input assembly file and performs two passes:
1. Pass 1: Scans for labels, directives, and builds the symbol table
2. Pass 2: Resolves symbols and emits the final binary output
## Runtime Dependencies
When compiled with GCC, the generated binary may depend on these runtime libraries:
| DLL | Source | License | AGPL Compatibility
|--------------------|--------------------------|-------------------------|-----|
| libgcc_s_seh-1.dll | GCC runtime | GPL + linking exception | Yes |
| libstdc++-6.dll | GNU C++ standard library | GPL + linking exception | Yes |
| KERNEL32.dll | Windows API | System component | Yes |
| msvcrt.dll | Microsoft C runtime | System component | Yes |
These are standard system or compiler-provided libraries.
They are not distributed with this repository and are automatically available on typical systems.
## Usage
After compiling codes, you can run:
```bash
./easm examples/hello.asm
```
Thank you for reading.