HOME

TheInfoList



OR:

The Parrot assembly language (PASM) is the basic assembly language used by the
Parrot virtual machine Parrot was a register-based process virtual machine designed to run dynamic languages efficiently. It is possible to compile Parrot assembly language and Parrot intermediate representation (PIR, an intermediate language) to Parrot bytecode ...
. PASM is the lowest level assembly language in the Parrot stack. The
Parrot intermediate representation The Parrot intermediate representation (PIR), previously called Intermediate code (IMC), is one of the two assembly languages for the Parrot virtual machine. The other is Parrot assembly language or PASM. Compared to PASM, PIR exists at a slightly ...
(PIR) is PASM extended to simplify development of compilers. The
hello world program ''Hello'' is a salutation or greeting in the English language. It is first attested in writing from 1826. Early uses ''Hello'', with that spelling, was used in publications in the U.S. as early as the 18 October 1826 edition of the '' Norwich ...
in PASM is simply: print "Hello world!\n" end Although it appears similar to
source code In computing, source code, or simply code, is any collection of code, with or without comment (computer programming), comments, written using a human-readable programming language, usually as plain text. The source code of a Computer program, p ...
in some
high-level programming language In computer science, a high-level programming language is a programming language with strong abstraction from the details of the computer. In contrast to low-level programming languages, it may use natural language ''elements'', be easier to ...
s, more complex PASM programs will resemble other assembly languages. The main exceptions to this
low level programming A low-level programming language is a programming language that provides little or no Abstraction (computer science), abstraction from a computer's instruction set architecture—commands or functions in the language map that are structurally sim ...
in PASM are string handling and, as shown above, input and output. Additionally, PASM has automatic
garbage collection Waste collection is a part of the process of waste management. It is the transfer of solid waste from the point of use and disposal to the point of treatment or landfill. Waste collection also includes the curbside collection of recyclable ...
from the virtual machine, and it does not allow
pointer arithmetic In computer science, a pointer is an object in many programming languages that stores a memory address. This can be that of another value located in computer memory, or in some cases, that of memory-mapped computer hardware. A pointer ''re ...
. Parrot assembly language has more instructions than hardware assembly languages, even CISC processors. This is because the
marginal cost In economics, the marginal cost is the change in the total cost that arises when the quantity produced is incremented, the cost of producing additional quantity. In some contexts, it refers to an increment of one unit of output, and in others it r ...
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 In visual arts, music and other media, minimalism is an art movement that began in post–World War II in Western art, most strongly with American visual arts in the 1960s and early 1970s. Prominent artists associated with minimalism include Do ...
.


External sources


References

{{DEFAULTSORT:Parrot Assembly Language Assembly languages Perl