Parrot assembly language
|
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.
External sources
- Parrot assembly language at dev.perl.org (http://dev.perl.org/perl6/pdd/pdd06_pasm.html)
- ParrotCode (http://www.parrotcode.org)