Assembler Playground

Write x86 and x64 assembly and see the encoded bytes instantly. Diagnostics, source-linked instruction boundaries and raw binary download.

Advertisement

Write assembly, see the bytes

Type an instruction and get its encoding immediately. No toolchain to install, no nasm invocation, no hexdump step. The playground assembles a documented Intel-syntax x86 and x64 subset in both 32-bit and 64-bit modes and shows the encoded bytes next to the source that produced them.

Each instruction is linked to its own byte range, so clicking a line highlights exactly the bytes it generated. That mapping is the whole point of the tool, and it is the thing that makes x86 encoding learnable rather than mysterious.

The questions this answers quickly

  • Why is this instruction longer than I expected? Watch the REX prefix appear the moment you touch r8 through r15, and watch the operand-size prefix appear on 16-bit operations.
  • How do I express this addressing mode? Try it. A malformed ModRM combination fails at assembly time with a diagnostic instead of producing something surprising at runtime.
  • What does the encoding look like without null bytes? Small immediates and register-to-register forms avoid them; absolute addresses rarely do. You can see which is which as you type.
  • Is this hex I found actually the instruction the disassembler claims? Type the mnemonic and compare.

Round-tripping with the disassembler

Assembly authoring lives here rather than inside the Machine Code Disassembler on purpose. The disassembler's job is reading unknown bytes across many architectures with one decoded instruction model. Authoring has the opposite shape: one syntax, deliberate input, immediate feedback. Splitting them keeps each one coherent.

They connect through handoffs. Assemble something and open it in the disassembler to see how a decoder reads it back, which is the fastest way to check whether your understanding of an encoding is right. Open it in the Hex Editor to place it inside a larger file, or send it to the Shellcode Emulator to step through it and watch the registers move.

Learning encoding by experiment

A productive exercise: write mov rax, 1, then mov eax, 1, then mov al, 1, and compare all three encodings. The operand size changes the instruction length, the presence of the REX prefix, and whether the immediate is one byte or four. Then try xor rax, rax against mov rax, 0 and see why the first one shows up everywhere in hand-written code.

Jump encodings reward the same treatment. Short jumps take a one-byte relative displacement, near jumps take four, and the assembler picks based on distance. Watching the encoding change as you move a label is more instructive than reading the rule.

32-bit and 64-bit are different languages

Switching modes changes more than the register names. In 64-bit mode the REX prefix appears whenever you touch the extended registers or need a 64-bit operand, writes to a 32-bit register zero the upper half while writes to a 16- or 8-bit register do not, and RIP-relative addressing replaces most of the absolute forms that 32-bit code uses freely.

Those rules are easy to recite and easy to get wrong. Assembling the same routine in both modes and comparing the output is the fastest way to internalise them, and it explains why porting 32-bit assembly by renaming registers produces code that assembles cleanly and behaves incorrectly.

Reading diagnostics

A failed assembly is usually more informative than a successful one. An operand-size mismatch means you asked for a combination the encoding cannot express, such as mixing register widths in a single instruction. An invalid addressing form usually means a scale factor other than 1, 2, 4 or 8, or an attempt to use a register that cannot serve as an index. An out-of-range immediate means the instruction has a narrower field than the value you supplied, and the fix is a different mnemonic rather than a different number.

Each diagnostic points at the construct that caused it, so the failure tells you which encoding rule you just met.

Scope and output

The supported instruction set is a documented subset rather than a complete x86 implementation. Coverage focuses on the general-purpose integer, control-flow, stack and addressing instructions that dominate hand-written assembly, shellcode and small experiments. Vector extensions and the more exotic corners of the instruction set are outside this release, and unsupported mnemonics produce a diagnostic rather than a guess.

Output downloads as raw binary, which is what you usually want for a payload, a test fixture, or something to feed a decoder. Examples ship with the tool so there is something to modify rather than a blank editor. Everything assembles locally, so nothing you write here leaves your browser.

Frequently Asked Questions

Is this a complete production assembler?+

No. It is a deterministic, documented Intel x86/x64 subset intended for learning and small analysis snippets. Unsupported instructions stop with an error.

Can I use labels?+

Yes. Relative calls, jumps, and conditional jumps can target labels or numeric addresses. The output table shows each final instruction boundary.

Can I inspect the generated bytes?+

Yes. Copy or download the raw bytes, or save them to Binary Lab and hand them to the disassembler, hex editor, binary diff tool, or shellcode emulator.

Related tools

This tool is provided for informational and educational purposes only. All processing happens in your browser — no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results.