Parrot assembly language

From Wikipedia, the free encyclopedia

Current event marker This article or section contains information about scheduled or expected future software.
The content may change dramatically as the software release approaches and more information becomes available.
Software Development

The Parrot assembly language or PASM is the basic assembly language used by the Parrot virtual machine, a part of the Perl 6 project.

PASM is the lowest level assembly language. The Parrot intermediate representation or PIR is PASM, extended to simplify development of compilers.

The hello world program in PASM is simply

print "Hello world!\n"
end

Though that looks like it would in some high-level languages, anything more complex than hello world starts to look very similar to other assembly languages. The main exceptions, though, to this low level are the string handing and, as you can see above, input and output. Additionally, PASM has automatic garbage collection from the virtual machine, and it does not allow pointer arithmetic.

Parrot assembly language has more instructions than any hardware assembly language, even any CISC processor. This is because it is very low-cost to make a new instruction in something like Parrot compared to the cost of making an instruction in hardware, and the creators of Parrot had no particular goal of minimalism.

[edit] External sources