Oddly, Windows x86 assembly language was the first programming language I ever learned, or at least found myself productive with.
Fast forward 10 years later, and, I had a website filled with various assembly language programs I had written over the years. But all in one terrible moment, due to some neglect on my part (3 months of Rackspace failing to charge my expired credit card), my entire site was deleted. To make matters worse, I later let my domain name expire, which was then taken over by squatters.
Fortunately, I still have copies of many of my old programs. On this page, I’m posting some interesting applications I created in assembly language.
I’ve already discussed the “HelloWorld” app in my previous post, Win32 x86 Assembly - Hello World. Essentially, when I did assembly programming, I would re-use this as a template for creating new programs.
This is probably the most useful assembly program in my archive. It’s a Windows mouse and keyboard automation program. The way it works is you provide a script (it has its own language, documented inside the program). I used it to automate (i.e., cheat) several games.
For example, here are four Hooker scripts for Warcraft III. When you start a new game, you run one of these scripts, and it will immediately press all the correct buttons/mouse strokes to get you a head-start in the game.
“Text Reader Square”
This is a (minimal) drag-and-drop graphical editing tool. You can place and drag shapes and text boxes with customizable fonts and colors.
Binary Search Tree
This is a simple implementation of a (dynamically-sized) binary search tree.
Jumber: A radix string converter
This is essentially number-base converter with support for customizable radix strings. The term “radix string” refers to the digits used to represent a number base—for example: binary is “01”, decimal is “0123456789”, and hexadecimal is “0123456789ABCDEF”.
At the time, my goal was to use this as interesting way to compress strings. For example, if you use “abcdefgh” as the radix for the string “dead”, when converted into hexadecimal results in the value “D4B”. This program allows you to save and load the compressed binary value to/from disk.
This was an attempt at registering custom, re-usable native Windows controls; in this case a toggle button.
I wanted to make a window I can see through, and came up with this simple example.
Here, I’m plugging a parametric equation into a grid of pixels to determine their color. The first example uses a Device-Dependent Bitmap and the second uses a Device-Independent Bitmap format. I used to have several interesting color patterns/animations, but these examples have been lost.
In these examples, I do some fancy stuff with OpenGL. What I did was follow the NeHe OpenGL tutorials, which was originally intended for C++, and implemented it assembly language.
The above were my attempts at generating sounds using DirectSound. The first two programs are simple waveform generators. The second two not only display the correct frets for several common guitar chords, are capable of generating the waveform for these chords.
These programs are functional TCP clients written in assembly language. Interestingly, the program is multi-threaded, which keeps it responsive.
Virtual Memory Tests
This program explores the interesting Windows feature known as PAGE_GUARD, which I use here as a “hook” to determine when a given page in RAM has been accessed.