xchg rax, rax

Assembly code can appear mysterious to the uninitiated. Aspects of the physical machine abstracted away in higher-level languages are referred to directly in its terse commands.

This chapbook of minimal assembly code poems (its author refers to them as "snippets") offers no solutions, context, or explanations to ease this gap, leaving the work of deciphering to the reader. For xorpd, its pseudonymous author, this is exactly the point: to immerse the reader in the machine level of code.

When working inside a computer, everything is eventually made of assembly, so this is where you go if you really want to understand how things work.

There is no extraneous word of text in the book to break that context. The title, xchg rax, rax, is a NOP instruction (pronounced no-op, for no operation): xchg exchanges the data of two operands, in this case of rax with itself. The author's name, xorpd, is a bitwise logical XOR (exclusive or) of packed double-precision floating-point values.

Read More

This entry originally appeared at esoteric.codes/blog/xchg-rax-rax, and may be a summary or abridged version.