Parrot assembly language

The Parrot assembly language (PASM) is the basic assembly language used by the Parrot virtual machine.

PASM is the lowest level assembly language in the Parrot stack. The Parrot intermediate representation (PIR) is PASM extended to simplify development of compilers.

The hello world program in PASM is simply:

print "Hello world!\n"
end

Although it appears similar to source code in some high-level programming languages, more complex PASM programs will resemble other assembly languages. The main exceptions to this low level programming in PASM are string handling and, as shown 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 hardware assembly languages, even CISC processors. This is because the marginal 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 of minimalism.

External sources

gollark: I agree, except for the part where it would be good.
gollark: Something being good in a hypothetical world which could not actually happen and would break rapidly if it did isn't actually very good.
gollark: I'm gollark!
gollark: If people just sit there militarylessly, they will be invaded whenever some sufficiently mean person realizes that they can have a military.
gollark: It's not a stable state.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.