Skip to content

Repository files navigation

FeatherPad ASM

A family of tiny native Windows editors written entirely in MASM x64. No C layer. No C++ layer. No CRT. No framework. No bundled runtime. Execution starts at WinMainCRTStartup and talks directly to Win32.

License: MIT Platform Language Runtime

FamilyCodePad editing a Python file with tabs, syntax coloring, line numbers, toolbar, and status bar

Why this exists

FeatherPad ASM started as one inconvenient question:

How much of a real Windows editor can exist without the usual runtime scaffolding?

The result is a set of five PE64 editors, from a tiny single-document notepad to a code-focused edition with tabs, syntax coloring, search across files, code runners, bookmarks, printing, word completion, session restore, and a dark native UI.

This is not an argument that every desktop app should be written in assembly. Most should not. FeatherPad is a compact case study in PE64, Win32, Unicode, explicit ownership, file safety, RichEdit behavior, and the Microsoft x64 ABI.

The headline numbers

Current local release build:

Item Value
FamilyCodePad.exe 103.5 KiB
All five editor executables together 255.5 KiB
FamilyCodePad source 20,498 lines of MASM
FamilyCodePad functions 198
PE sections 4
SizeOfImage 168 KiB
Imported APIs 139 functions from 6 Windows system DLLs
Runtime none: /nodefaultlib, WinMainCRTStartup

Editions

Edition Current binary size Purpose
BabyPad ~13 KiB One-document editor: open, save, dark mode, text sizing, common encodings.
FatherPad ~17 KiB Adds up to 32 tabs and Unicode search.
GrandFatherPad ~20 KiB Adds real RTF input/output, bold, text color, and highlighting.
FamilyPad ~104 KiB Full text-editing edition with polished tabs, find/replace, status interactions, formatting, line operations, drag/drop, save-all, reload, and more.
FamilyCodePad 103.5 KiB Code-focused edition with tabs, syntax coloring, runners, terminal launch, bookmarks, recent files, find-in-files, printing, and word completion.

FamilyCodePad features

FamilyCodePad is the flagship build and the most useful edition for programmers.

  • Owner-drawn tabs with close buttons, modified indicators, middle-click close, and session restore.
  • Native syntax coloring for Python, C/C++, JavaScript/TypeScript, JSON, MASM, HTML, and CSS.
  • Line-number gutter, current-line accent, and per-tab bookmarks.
  • Ctrl+Shift+F Find in Files across the active file's folder, with clickable path(line): text results and F4 navigation.
  • Saved-file runners for Python, JavaScript, C/C++, MASM, and HTML.
  • Terminal launch in the active file's directory.
  • Word completion, print support, recent files, go-to-line, line operations, indentation helpers, and trailing-space cleanup.
  • Dark editor/title bar support, DPI-aware UI, status-bar cells, and persistent settings in %APPDATA%\FamilyCodePad.ini.

FamilyCodePad Find in Files result tab

Footprint benchmark

These are local measurements from one Windows 11 system with a Ryzen 7 7445HS and 16 GB RAM. Each program had one warm-up run and then five measured launches.

VS Code was tested without extensions and GPU acceleration. Notepad++ was tested without plugins and session restore.

Program Size / install Working Set Private Memory Process / Threads First window
FamilyCodePad, one tab 103.5 KiB 19.72 MiB 2.74 MiB 1 / 7 260 ms
FamilyCodePad, five tabs 103.5 KiB 19.86 MiB 2.83 MiB 1 / 7 895 ms
Windows Notepad 17.89 MiB 163.84 MiB 95.18 MiB 2 / 58 307 ms
Notepad++ 8.9.7 19.69 MiB 67.25 MiB 44.17 MiB 1 / 18 305 ms
VS Code 1.131 1012.06 MiB 1370.98 MiB 848.73 MiB 8 / 214 471 ms

FamilyCodePad benchmark card

Important caveat: this is a footprint comparison, not a product-completeness comparison. VS Code and Notepad++ do vastly more. Working Set can also be noisy for multi-process applications and shared pages, so Private Memory is the most useful number here.

Release size proof

Release folder showing the five editor executables

Architecture

One visible editor control, tab snapshots on the heap

FatherPad, GrandFatherPad, FamilyPad, and FamilyCodePad do not create a separate editor window for every tab. They keep one visible EDIT/RichEdit control and store inactive documents as heap snapshots.

During a tab switch:

  1. The active document is copied into a newly allocated snapshot.
  2. Allocation and copying must complete successfully.
  3. Only then is the previous snapshot released.
  4. The destination snapshot is loaded into the shared editor control.

This allocate-before-free order prevents an allocation failure from destroying the last valid tab contents. Each tab keeps its own path, length, dirty state, encoding, line-ending mode, language state, and heap pointer.

File safety

Plain-text saves do not overwrite the destination directly. Output is written to a temporary file, flushed with FlushFileBuffers, and then moved over the destination. If the write fails, the previous file remains available.

Embedded NUL bytes are rejected instead of silently truncating text. Large input is bounded by a 256 MiB safety ceiling.

ABI and PE behavior

The assembly implementation follows the Microsoft x64 ABI:

  • 16-byte stack alignment at call sites.
  • Required shadow space.
  • Preserved nonvolatile registers.
  • Unwind declarations matching each prologue and epilogue.
  • Windows SDK structure layout expectations, including EDITSTREAM packing.
  • Conventional PE64 behavior with ASLR, NX, and valid x64 unwind metadata.

Common features

  • Native Unicode Win32 interface.
  • UTF-8, UTF-16 LE/BE, and legacy ANSI input.
  • UTF-8 output for plain text.
  • Dark title bar, themed controls, and dark/light editor colors.
  • ClearType fonts with DPI-aware sizing.
  • Command-line file opening.
  • No networking, telemetry, updater, or background service.

Download

Prebuilt Windows x64 executables are attached to the latest GitHub Release.

The binaries are currently not digitally signed, so Windows SmartScreen may warn on first launch. If you do not trust unsigned binaries, build from source and verify checksums.

Build from source

Requirements:

  • Windows x64.
  • Visual Studio 2022 or Visual Studio Build Tools.
  • Desktop development with C++ workload.

Build all editions:

build.bat

The script locates Visual Studio with vswhere, initializes an x64 developer environment, builds all five editions into bin\, and removes intermediate object files.

Keyboard shortcuts

Shortcut Action Editions
Ctrl+N New or clear active document All
Ctrl+O Open file All
Ctrl+S Save All
Ctrl+Shift+S Save As All
Ctrl+D Toggle dark mode All
Ctrl++, Ctrl+-, Ctrl+0 Change/reset text size All
Ctrl+T, Ctrl+W Open/close tab FatherPad and above
Ctrl+Tab, Ctrl+Shift+Tab Next/previous tab FatherPad and above
Ctrl+F, F3 Search/find next FatherPad and above
Ctrl+B Toggle bold GrandFatherPad and FamilyPad
Ctrl+H Replace FamilyPad and FamilyCodePad
Ctrl+G Go to line FamilyPad and FamilyCodePad
Ctrl+Alt+S Save all modified tabs FamilyPad and FamilyCodePad
Ctrl+Shift+F Find in Files FamilyCodePad
F4 Open file and line under result row FamilyCodePad
Ctrl+F5 Save and run current code file FamilyCodePad
Ctrl+Alt+T Open terminal in current file folder FamilyCodePad
F8 Refresh syntax colors FamilyCodePad
F11 Toggle borderless fullscreen FamilyCodePad
Ctrl+F2 Toggle bookmark FamilyCodePad
F2, Shift+F2 Next/previous bookmark FamilyCodePad
Ctrl+Space Word completion FamilyCodePad
Ctrl+P Print FamilyCodePad

Repository layout

.
├── src/
│   ├── BabyPad.asm
│   ├── FatherPad.asm
│   ├── GrandFatherPad.asm
│   ├── FamilyPad.asm
│   └── FamilyCodePad.asm
├── docs/
│   └── assets/
│       ├── screenshot-familycodepad.png
│       ├── screenshot-find-in-files.png
│       ├── screenshot-release-sizes.png
│       └── benchmark-footprint.png
├── .github/workflows/build.yml
├── build.bat
├── README.md
├── README.fa.md
├── CONTRIBUTING.md
├── SECURITY.md
└── LICENSE

Each .asm file is standalone and selects its own edition. Conditional assembly removes unavailable features before linking.

Project scope

FeatherPad ASM is not trying to replace VS Code, Notepad++, or a full IDE. Extensions, language servers, debugging, cloud sync, collaborative editing, and package ecosystems are outside the current scope.

The project exists as a compact, auditable Windows editor and a practical example of building a real PE64/Win32 GUI application with almost no software stack between the program and the OS.

Contributing, security, and license

Development and test guidance is in CONTRIBUTING.md. Security-sensitive issues should follow SECURITY.md.

Released under the MIT License.

About

An ultra-lightweight, tabbed text editor crafted entirely in x64 Assembly.

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages