gitmyhub

TinyRetroPad

Assembly ★ 1.6k updated 27d ago

A working Notepad style Windows text editor written entirely in x86 assembly and compiled down to about 2.5 kilobytes, as a size optimization exercise.

AssemblyMASMCrinklerWinAPIsetup: hardcomplexity 4/5

TinyRetroPad is a fully working, Notepad style text editor for Windows that is written in x86 assembly language and compiled down to roughly 2.5 kilobytes. It is a fork of an earlier tiny editor project, and its whole point is to prove how small a real, usable Windows application with actual menus can be made, as an exercise in extreme size optimization rather than a tool meant for daily use.

Under the hood, it is basically a thin wrapper around a built in Windows text editing control, so most of the heavy lifting, like text rendering and cursor handling, is not written by hand at all. On top of that bare control, the project adds a full set of familiar Notepad features: File, Edit, Format, View, and Help menus, opening and saving files, printing and page setup, find, replace, and go to line, font selection, word wrap, inserting the current time and date, and a status bar showing the current line and column. Each of these was added while tracking exactly how many extra bytes it cost, and that growth log is kept at the top of the project's main source file.

Building it requires a specific assembler and a size optimizing linker called Crinkler, both of which are common in the demoscene community that specializes in tiny, hand tuned programs. Because Crinkler produces unusual executables, some antivirus software, including Windows Defender, may flag or delete the resulting file, so building and testing it requires setting up an exception for that folder.

This project will mostly appeal to people interested in low level Windows programming, assembly language, or the demoscene tradition of squeezing real functionality into the smallest possible program size. It is released under the Apache License 2.0.

Where it fits