Portable Intermediate Representation
Read structured examples that show values, operations, subroutines, and the relationship between source instructions and runtime execution.
Explore PIR examplesPractical runtime studies
Explore compact PIR and PASM programs, follow their bytecode path, and use each example as a starting point for understanding virtual-machine behavior.
Example library
These categories preserve the original learning path while presenting it as a practical reference for virtual-machine development.
Read structured examples that show values, operations, subroutines, and the relationship between source instructions and runtime execution.
Explore PIR examplesInspect compact assembly-oriented programs to see registers, operations, control flow, and explicit bytecode-oriented thinking.
Explore PASM examplesExample conventions
A consistent visual language makes it easier to distinguish what you write, what the runtime prints, and what deserves extra attention.
.sub 'main'
say "HELLO"
.return
.end.pir and PASM files with .pasm.Running a sample
Use a local runtime executable, then compare direct execution with an explicitly compiled bytecode file.
Place the example in a file using the suffix expected by its language or assembly format.
Invoke the runtime with the source file and inspect the output or diagnostic information.
Write a bytecode file, execute it again, and compare the two paths.
Command reference
The commands below are intentionally small: they make the distinction between source input, compiled bytecode, and runtime output easy to inspect.
# Run the source example
parrot foo.pir
# Compile, then run bytecode
parrot -o foo.pbc foo.pir
parrot foo.pbcAbout this page
This page collects compact runtime exercises for readers who want to move from documentation into execution. For questions or corrections about the resource, write to info@pcodevault.en-html.com.