← Frames, recursion, and interop

Commands

Frames, recursion, and interop

Build and run this example

Terminal
mkdir -p build
./zig-out/bin/zp64c compile docs/tutorial-examples/aggregate-return.zp64 -o build/aggregate-return.prg
x64sc -autostart build/aggregate-return.prg

Return to the guide

Generate assembly for the aggregate call

Terminal
mkdir -p build
./zig-out/bin/zp64c asm docs/tutorial-examples/aggregate-return.zp64 -o build/aggregate-return.asm

Return to the guide

Build and run this example

Terminal
mkdir -p build
./zig-out/bin/zp64c compile docs/tutorial-examples/stack-result.zp64 -o build/stack-result.prg
x64sc -autostart build/stack-result.prg

Return to the guide

Build and find the deepest call address

Terminal
mkdir -p build
./zig-out/bin/zp64c compile docs/tutorial-examples/stack-result.zp64 -o build/stack-result.prg
awk '$3 == ".identity" {{ print $2 }}' build/stack-result.prg.labels

Return to the guide

Reproduce the nested call measurements

Terminal
mkdir -p build
ZEROPAGE_EMU_FILTER=optimization_reference/abi_calls/ zig build emu-test > build/abi-calls.log 2>&1
awk '/^host-(stack-)?metrics/ && $2 ~ /nested_(static|stack)/' build/abi-calls.log

Return to the guide