This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Parrot assembly language" – news ·newspapers ·books ·scholar ·JSTOR(January 2021) (Learn how and when to remove this message) |
TheParrot assembly language (PASM) is the basicassembly language used by theParrot virtual machine.[citation needed]
PASM is the lowest level assembly language in the Parrot stack. TheParrot intermediate representation (PIR) is PASM extended to simplify development of compilers.
Thehello world program in PASM is simply:
print "Hello world!\n"end
Although it appears similar tosource code in somehigh-level programming languages, more complex PASM programs will resemble other assembly languages. The main exceptions to thislow level programming in PASM are string handling and, as shown above, input and output. Additionally, PASM has automaticgarbage collection from the virtual machine, and it does not allowpointer arithmetic.
Parrot assembly language has more instructions than hardware assembly languages, evenCISC processors. This is because themarginal cost of creating a new instruction in Parrot is low compared to the marginal cost of doing so in hardware, and the creators of Parrot had no particular goal ofminimalism.