8. Encoding
x86 instruction encoding is notoriously complex, with variable-length instructions
and multiple encoding options for the same operation. The encode function handles
all details, producing the exact same bytes as a production assembler like NASM.