sed/regex Based BrainFuck Compiler

BrainFuck is an ‘esoteric’ programming language with only 8 one-character instructions. I’ve used it here-and-there for well over a decade. I love minimalist languages, so RISCy. A brainfuck environment operates on a large array of data. There’s an instruction to move the pointer in this array forwards and backwards and to increment or decrement it’s […]

Screen Shot 2017-04-12 at 9.41.41 PM

apples

Assembly is Too High Level: Commutative Property, Sometimes (it may save your byte)

I remember learning these properties in basic algebra: Associative, Distributive, and Commutative. It’s the Commutative property that states that a + b = b + a. The same principle is true with multiplication. In x86 pointer math, of course the results of these operations follow the commutative property; that’s just math. However, the machine encoding […]


Assembly is Too High-Level: Signed Displacements

For those that don’t know about unsigned and signed data types, it’s not all that complicated. One byte can hold a total of 256 possible values. If these values were only positive numbers and included zero, we would have a number range of 0-255. But what if we wanted negative numbers? The byte is divided; […]

Screen Shot 2017-01-31 at 9.28.13 PM

goatse

Boot Sector Graphical Programming (Tutorial)

This tutorial is aimed at those that have some assembly experience, but very minimal 16-bit BIOS programming experience, in other words; a short list of some of my friends that I want to coerce into doing some BIOS programming. Assembling: Qemu Assemble source: nasm yourboot.asm -f bin -o yourboot.bin Run with qemu: qemu tronsolitare.bin Run […]


CactusCon Slides: Machining, A Love Story

Here is the full ~6Mb image that I used as my slide deck within MS Paint in Windows 3.1 for my CactusCon 2016 presentation: Machining, A Love Story. Below the large image are all the images again, slide-by-slide, with brief notes; so there can be some context. All non-screenshot art done by KRT c0c4!N (my […]

face

Assembly is Too High Level: Redundant Bit commands 2

Compared to some of the most recent posts in this series, this one is a pretty basic example of a redundancy. This redundancy applies to the bit shifting instructions of: RCL, RCR, ROL, ROR, SAL, SAR, SHL, and SHR. These instructions can take an 8-bit immediate value, but there is also dedicated encoding for the […]

bits

Assembly is Too High Level: SIB Doubles 1

I’m finding that there is a full playground in the ModR/M encoding, and this post is specifically about a SIB obscurity, only because of the way I see NASM assembling some of my assembly. Then I found other cool things NASM puts up with Consider this code: Functionally, they both result in the same thing. […]

SIBs04

lia03

Assembly is Too High Level: Load InEffective Address 1

The LEA (Load Effective Address) instruction allows us to copy the address of a memory location (in the memory addressing format you would find in ModR/M encoding) into a register. This instruction is also often used as a multiplication math hack used in place of MUL when LEA can be used instead. With the memory […]