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


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


Assembly is Too High-Level: BSWAPin 16-bit Registers 1

  But what actually happens? As it turns out, the Intel manual is correct in stating that you should use xchg instead of bswap. In practice, it’s hard to say the result of this 16-bit bswap is ‘undefined;’ as it is consistent with what it does each time. Instead of swapping the contents of ah […]


Assembly is Too High-Level: Self Modifying Code with Basic Arithmetic

I should say that we are able to do this trick all in assembly, but none of it would make sense without an understanding of machine code. This post is about simple self-modifying code tricks you can do with addition and subtraction to an instruction to make it another instruction, while also maintaining consistent addressing […]


Follow-up on creating Vm0wd2Qy > 9000

  This is referring to my previous post Vm0wd2Qy, and a clarification of how I got my results. If you repeatedly Base64 encode a string, you will eventually get Vm0wd2Qy as the first part of your string. In my previous post, I have 10,000 characters that you would eventually get as the first part of your string […]


Assembly is Too High Level: Jump ‘Near’ When Short

This article is about a redundancy with short and near jumps. Both of the jumps I will talk about are relative; the immediate data after the jump instruction is a signed offset for how far to jump. The difference between a short and near jump is simple: the 0xeb short jump has a byte for […]


Vm0wd2Qy 2

This article will be about 2 encodings/interpretations of binary; ASCII and Base64. ASCII is an 8-bit (debatable I know, but go with it) character encoding, and Base64 is a 6-bit character encoding. Conversions can be made between them: Not too interesting. This post is more about a string like “Vm0wd2Qy”: [2nd command is just there […]


Assembly is Too High Level: Subtracting by Comparing (Propeller)

If you’re familiar with x86, you’d know that a CMP (compare) instruction is the same as a SUB (subtract) instruction, with exception to the destination operand being written to. In other words, CMP is like a subtract, it just doesn’t write the value when done (but it does set all of the flags that a […]