LEARN / A PATH THROUGH THE LAB
Start with bits.
Keep asking why.
Six stops, from an eight-bit token to an independently tested program. Short experiments here; the complete explanations live in the project’s canonical guides.
Start in your language
The same literal example, quickstart and support boundaries in eight languages. Detailed guides and interactive controls currently use English.
FIRST EXPERIMENT / SIX LITERAL BYTES
One byte. One word. One branch.
Start with the handwritten source. These controls inspect edits in 16-bit context; they do not execute code or change CPU lab state. Each change stays in this page until you reset or reload.
- 01
A byte has eight bit weights
The low immediate byte starts at decimal 52. Its rightmost bit has weight one. Predict the result before flipping it.
- 02
A word puts the low byte first
The opcode B8 selects MOV AX. The immediate is low byte + 256 × high byte. Swapping the bytes changes the value while preserving this opcode and instruction length.
- 03
A short branch uses a signed byte
EB FA begins at offset 4. The instruction ends at logical IP 0x7C06. FA is −6 as a signed byte; its high bit has weight −128. Flip that bit and predict the new target.
The target is offset 0 inside the original six-byte program.
Current literal byte notation, in file order:
10010000 10111000 00110100 00010010 11101011 11111010
Learning path
- 01
Separate notation from a byte
10111000is eight text characters representing one byte,B8. A packer converts notation into byte values. It does not choose an instruction. - 02
Read an opcode and immediate
In 16-bit mode,
B8 2A 00loads 42 into AX. Change one low opcode bit to choose another register; change an immediate bit to choose another value. - 03
Give the bytes a boot environment
Legacy BIOS loads a first sector at physical
0x7C00. Inspect the explicit code, message, padding, and final55 AAmarker. A marker identifies a candidate; it cannot prove correct behavior. - 04
Follow state, one instruction at a time
A register is a current value, a flag records a condition, and IP selects the next instruction. Step through the model to see a branch follow its signed displacement from the end of an instruction.
- 05
Ask a real execution environment
Package literal source, verify sizes and reviewed hashes, then boot a disposable QEMU guest. Linux ELF examples require Linux x86-64; their expected nonzero exit statuses are demonstrations, not generic failures.
- 06
Solve one problem and explain it
Use a binary challenge to practice the mechanism you just learned. Then inspect an example’s source and byte table before changing it. Correct bytes and a reproducible check matter together.