IMCC’s main purpose is assembling PASM or PIR source files. It can run them immediately or generate a Parrot bytecode file for running later.
Internally, IMCC works a little differently with PASM and PIR source code, so each has different restrictions. The default is to run in a “mixed” mode that allows PASM code to mix with the higher-level syntax unique to PIR.
A file with a
extension is treated as pure PASM code,
as is any file run with the
option. These files can use macros, but none of PIR’s syntax. This mode is
mainly used for running pure PASM tests that were originally written
The documentation that comes with IMCC
languages/imcc/docs/ and the test suite in
languages/imcc/t are good starting points for
digging deeper into its syntax and functionality.
The syntax of statements in PIR is much more flexible than PASM. All PASM opcodes are valid PIR code, so the basic syntax is still an opcode followed by its arguments:
print "He's pining for the fjords.\n"
The statement delimiter is a newline
\n, just like
PASM, so each statement has to be on its own line. Any statement can
start with a label.
LABEL: print I1
But unlike PASM, PIR has some higher-level constructs, including symbol operators:
I1 = 5
count = 5
and complex statements built from multiple keywords and symbol operators:
if I1 <= 5 goto LABEL
We’ll get into these in more detail as we go.
are marked by a hash sign (
#). Commented ...