Apex › Systems & OS

How code becomes machine code

The CPU only runs opcodes, so something has to turn your text into them. A narrated walk through the passes — lex the characters into tokens, parse the tokens into a tree that captures precedence, then walk the tree to emit instructions. The finale is a real tiny compiler: type an arithmetic expression and watch the actual tokens, AST, and assembly it produces.

More in Systems & OS