Team LiB   Previous Section   Next Section

7.5 IMCC Command-Line Options

Since IMCC is both an assembler and a Parrot bytecode interpreter, it has options to control both behaviors. Some options may have changed by the time you read this, especially options related to debugging and optimization. The document languages/imcc/docs/running.pod should have the latest details.

7.5.1 General Usage

imcc [options] file [arguments]

The file is either an .imc or .pasm source file or a Parrot bytecode file. Parrot creates a PerlArray object to hold the command-line arguments and stores it in P0 on program start.

7.5.2 Assembler Options

-a, --pasm

Assume PASM input on stdin. When IMCC runs a source file with a .pasm extension, it parses the file as pure PASM code. This switch turns on PASM parsing (instead of the default PIR parsing) when a source file is read from stdin.


Assume PBC file on stdin. When IMCC runs a bytecode file with a .pbc extension, it immediately executes the file. This option tells IMCC to immediately execute a bytecode file piped in on stdin.

-d ,--debug [ hexbits]

Turn on debugging output. The -d switch takes an optional argument, which is a hex value of debug bits. The individual bits are shown in Table 7-1. When hexbits isn't specified, the default debugging level is 0001. If the hexbits is separated from the -d switch by whitespace, it has to start with a number.

Table 7-1. Debug bits


Debug bit





















To produce a huge output on stderr, turn on all the debugging bits:

$ imcc -d 0ffff ...

Print a short summary of options to stdout and exit.

-o outputfile

Act like an assembler. With this switch IMCC won't run code unless it's combined with the -r switch. If the name of outputfile ends with a .pbc extension, IMCC writes a Parrot bytecode file. If outputfile ends with a .pasm extension, IMCC writes a PASM source file, even if the input file was also PASM. This can be handy to check various optimizations when you run IMCC with the -Op switch.


Immediately execute bytecode. This is the default unless -o is present. The combination of -r -o output.pbc writes a bytecode file and executes the program.


One -v switch (imcc -v) shows which files are worked on and prints a summary of register usage and optimization statistics. Two -v switches (imcc -v -v) also prints a line for each individual processing step.


Turn on yydebug for yacc/bison.


Print the program version to stdout and exit.

-O x

Turn on optimizations. The flags currently implemented are shown in Table 7-2.

Table 7-2. Optimizations




No optimization (default).


Optimizations without life info (e.g., branches and constants).


Optimizations with life info.


Rearrange PASM registers with the most-used first.

7.5.3 Bytecode Interpreter Options

The interpreter options are mainly for selecting which runtime core to use for interpreting bytecode. The current default is the computed goto core if it's available. Otherwise the fast core is used.


Activate bounds checking. This also runs with the slow core as a side effect.


Deactivate the computed goto core (CGoto) and run with the fast core.


Run with the JIT core if available.


Activate profiling. This prints a summary of opcode usage and execution times after the program stops. It also runs within the slow core.


Run with the CGoto-Prederefed core if it's available. Otherwise run with the Prederefed core.


Run with the Switched core.


Trace execution. This also turns on the slow core.


Wait for a keypress before running.

    Team LiB   Previous Section   Next Section