Category Archives : Machine Code

ARM 12-bit Immediates are Too High Level

The below post will be talking in the context of 32-bit ARMv7. A video that supplements this content can be found here:   The Immediate Issue Those familiar with the ‘Immediate’ form of many ARM instructions may know that these 12 bits to encode the immediate value aren’t as simple as it may seem […]

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 […]

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: 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. […]