Classroom Public page

Lab Pack 11: Compiler III (Week 12)

199 words

OS-aware compilation. Four worksheets in worksheets/ch11/ extend the compiler to emit calls into the operating-system standard library.


Anchors the week

Week 12: Compiler III. The compiler now emits call Math.multiply 2 when it sees Math.multiply(a, b) in source; the linker resolves the name against the OS object file (which you write in week 13).

Concept the lab embodies

Cross-module name resolution at the language level. The compiler emits unresolved references; the linker resolves them against separately-compiled OS object files.

The four worksheets

Worksheet Time Purpose
lab-11.1-library-call-code-generation.md ~90 min Method-call syntax emits library-call ops
lab-11.2-multi-file-compilation.md ~120 min Each .jack file compiles separately; linker combines
lab-11.3-end-to-end-on-virtus-console-hdmi.md ~120 min HDMI output from a compiled program
lab-11.4-compiler-output-quality-reconciliation.md ~90 min Compare your compiler's VM bytecode to optimal hand-written VM

Grading rubric

Per-worksheet rubrics. Week-level: multi-file program compiles, links, and runs on Virtus Console with HDMI output; library calls resolve correctly through the linker.

What's next

Lab pack 12: Virtus OS. You write the OS your compiled programs call into.