Master the fundamental concepts of instruction set architecture through this focused micro-challenge.
x86 instructions are byte sequences built from prefixes, opcode, ModR/M, SIB, displacement, and immediate fields. Disassemblers walk these bytes; encoders emit them. Understanding the format is prerequisite to writing tools like yours.
cLoading…
The ModR/M byte names two registers and an addressing mode:
For example, 89 C3 is MOV EBX, EAX in 32-bit mode: opcode 89, ModR/M places source and destination registers.
For this exercise, you will hand-encode three instructions and verify with objdump -d or the mini disassembler. This task asks you to treat bytes as structured data, the same skill malware analysts use when carving shellcode.
Keep the relevant datasheet, ISA manual, or architecture textbook chapter open while you implement. When your output disagrees with the reference trace on the same program, the bug is usually a mis-decoded opcode, a stale register read, or a flag bit left unchanged after arithmetic.
For this exercise, you will use those habits while implementing the requirement in the starter code. Microarchitectural product names change across CPU generations, but the control ideas (fetch, bypass, cache lines, vector lanes) stay stable enough to debug from first principles.
Manually encode 3 x86 instructions to bytes.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github