EXPcalibur guide

The compiler lowers an expression; the VM evaluates its steps.

The compiler turns one expression into five stack movesThe compiler turns one expression into five stack movesSOURCEreturn (7 + 5) * 3;The brackets decide the order.EMITTED STEPSTACK AFTER THAT STEP1PUSH 77Start the left side2PUSH 575Add needs two inputs3ADD127 + 5 becomes 124PUSH 3123Prepare the multiply5MUL3612 × 3 becomes 36The rightmost stack value is on top. Frame and return instructions come after this example.

Read each stack row after the corresponding operation. ADD consumes two values and leaves one; MUL does the same. The source expression's grouping survives as instruction order.