text:
Amethyst

Amethyst is a violet variety of quartz. The name comes from the Koine Greek αμέθυστος amethystos from $α-$ a-, "not" and $μεθύσκω$ (Ancient Greek) / $μεθώ$  (Modern Greek), "intoxicate", a reference to the belief that the stone protected its owner from drunkenness. Ancient Greeks wore amethyst and carved drinking vessels from it in the belief that it would prevent intoxification.

Amethyst, a semiprecious stone, is often used in jewelry.

Structure
Amethyst is a purple variety of quartz and owes its violet color to irradiation, impurities of iron  and in some cases other transition metals, and the presence of other trace elements, which result in complex crystal lattice substitutions. The irradiation causes the iron ions that replace Si in the lattice to lose an electron and form a $2$ color center. Amethyst is a three-dimensional network of tetrahedra where the silicon atoms are in the center and are surrounded by four oxygen atoms located at the vertices of a tetrahedron. This structure is quite rigid and results in quartz's hardness and resistance to weathering. The hardness of the mineral is the same as quartz, thus making it suitable for use in jewelry.

Hue and tone
Amethyst occurs in primary hues from a light lavender or pale violet to a deep purple. Amethyst may exhibit one or both secondary hues, red and blue. High-quality amethyst can be found in Siberia, Sri Lanka, Brazil, Uruguay, and the Far East. The ideal grade, called "Deep Siberian", has a primary purple hue of around 75–80%, with 15–20% blue and (depending on the light source) red secondary hues. "Rose de France" is defined by its markedly light shade of the purple, reminiscent of a lavender / lilac shade. These pale colors were once considered undesirable, but have recently become popular due to intensive marketing.

Green quartz is sometimes called green amethyst; the scientific name is prasiolite. Other names for green quartz are vermarine and lime citrine.

Amethyst frequently shows color zoning, with the most intense color typically found at the crystal terminations. One of gem cutters' tasks is to make a finished product with even color. Sometimes, only a thin layer of a natural, uncut amethyst is violet colored, or the color is very uneven. The uncut gem may have only a small portion that is suitable for faceting.

The color of amethyst has been demonstrated to result from substitution by irradiation of trivalent iron (Fe3+) for silicon in the structure, in the presence of trace elements of large ionic radius, and to a certain extent, the amethyst color can naturally result from displacement of transition elements even if the iron concentration is low. Natural amethyst is dichroic in reddish violet and bluish violet, but when heated, turns yellow-orange, yellow-brown, or dark brownish and may resemble citrine, but loses its dichroism, unlike genuine citrine. When partially heated, amethyst can result in ametrine.

Amethyst can fade in tone if overexposed to light sources, and can be artificially darkened with adequate irradiation. It does not fluoresce under either short-wave or long-wave UV light.

Geographic distribution
Amethyst is found in many locations around the world. Between 2000 and 2010, the greatest production was from Marabá and Pau d'Arco, Pará, and the Paraná Basin, Rio Grande do Sul, Brazil; Sandoval, Santa Cruz, Bolivia; Artigas, Uruguay; Kalomo, Zambia; and Thunder Bay, Ontario. Lesser amounts are found in many other locations in Africa, Brazil, Spain, Argentina, Russia, Afghanistan, South Korea, Mexico, and the United States. Amethyst is produced in abundance in the state of Rio Grande do Sul in Brazil where it occurs in large geodes within volcanic rocks. Many of the hollow agates of southwestern Brazil and Uruguay contain a crop of amethyst crystals in the interior. Artigas, Uruguay and neighboring Brazilian state Rio Grande do Sul are large world producers, with lesser quantities mined in Minas Gerais and Bahia states. The largest amethyst geode found as of 2007 was the Empress of Uruguay, found in Artigas, Uruguay in 2007. It stands at a height of 3.27 meters, lies open along its length, and weighs 2.5 tons.

Amethyst is also found and mined in South Korea. The large opencast amethyst vein at Maissau, Lower Austria, was historically important, but is no longer included among significant producers. Much fine amethyst comes from Russia, especially near Mursinka in the Ekaterinburg district, where it occurs in drusy cavities in granitic rocks. Amethyst was historically mined in many localities in south India, though these are no longer significant producers. One of the largest global amethyst producers is Zambia in southern Africa, with an annual production around 1000 tons.

Amethyst occurs at many localities in the United States. The most important production is at Four Peaks, Gila and Maricopa Counties, Arizona, and Jackson's Crossroads, Wilkes County, Georgia.

Smaller occurrences have been reported in the Red Feather Lakes, near Fort Collins, Colorado; Amethyst Mountain, Texas; Yellowstone National Park; Delaware County, Pennsylvania; Haywood County, North Carolina; Deer Hill and Stow, Maine, and in the Lake Superior region of Minnesota, Wisconsin, and Michigan.

Amethyst is relatively common in the Canadian provinces of Ontario and Nova Scotia. The largest amethyst mine in North America is located in Thunder Bay, Ontario.

Amethyst is the official state gemstone of South Carolina. Several South Carolina amethysts are on display at the Smithsonian Museum of Natural History.

History
Amethyst was used as a gemstone by the ancient Egyptians and was largely employed in antiquity for intaglio engraved gems.

The ancient Greeks believed amethyst gems could prevent intoxication, while medieval European soldiers wore amethyst amulets as protection in battle in the belief that amethysts heal people and keep them cool-headed. Beads of amethyst were found in Anglo-Saxon graves in England. Anglican bishops wear an episcopal ring often set with an amethyst, an allusion to the description of the Apostles as "not drunk" at Pentecost in Acts 2:15.

A large geode, or "amethyst-grotto", from near Santa Cruz in southern Brazil was presented at a 1902 exhibition in Düsseldorf, Germany.

Synthetic amethyst
Synthetic (laboratory-grown) amethyst is produced by a synthesis method called hydrothermal growth, which grows the crystals inside a high-pressure autoclave.

Synthetic amethyst is made to imitate the best quality amethyst. Its chemical and physical properties are the same as those of natural amethyst, and it cannot be differentiated with absolute certainty without advanced gemmological testing (which is often cost-prohibitive). One test based on "Brazil law twinning" (a form of quartz twinning where right- and left-hand quartz structures are combined in a single crystal ) can be used to identify most synthetic amethyst rather easily. Synthesizing twinned amethyst is possible, but this type is not available in large quantities in the market.

Treated amethyst is produced by gamma ray, X-ray, or electron-beam irradiation of clear quartz (rock crystal), which has been first doped with ferric impurities. Exposure to heat partially cancels the irradiation effects and amethyst generally becomes yellow or even green. Much of the citrine, cairngorm, or yellow quartz of jewelry is said to be merely "burnt amethyst".

Ancient Greece
The Greek word amethystos may be translated as "not drunken", from Greek a-, "not" +, "intoxicated". Amethyst was considered to be a strong antidote against drunkenness.{{efn| In his poem "L'Amethyste, ou les Amours de Bacchus et d'Amethyste" (Amethyst or the loves of Bacchus and Amethyste), the French poet Rémy Belleau (1528–1577) invented a myth in which Bacchus, the god of intoxication, of wine, and grapes was pursuing a maiden named Amethyste, who refused his affections. Amethyste prayed to the gods to remain chaste, a prayer which the chaste goddess Diana answered, transforming her into a white stone. Humbled by Amethyste's desire to remain chaste, Bacchus poured wine over the stone as an offering, dyeing the crystals purple.{{efn| The "myth" of Amethyste and Bacchus was invented by the French poet Remy Belleau (1528–1577). }} {{rp|style=ama|p= 58–59}}

Variations of the story include that Dionysus had been insulted by a mortal and swore to slay the next mortal who crossed his path, creating fierce tigers to carry out his wrath. The mortal turned out to be a beautiful young woman, Amethystos, who was on her way to pay tribute to Artemis. Her life was spared by Artemis, who transformed the maiden into a statue of pure crystalline quartz to protect her from the brutal claws. Dionysus wept tears of wine in remorse for his action at the sight of the beautiful statue. The god's tears then stained the quartz purple.

This myth and its variations are not found in classical sources. However, the goddess Rhea does present Dionysus with an amethyst stone to preserve the wine-drinker's sanity in historical text.

Other cultural associations
Tibetans consider amethyst sacred to the Buddha and make prayer beads from it. Amethyst is considered the birthstone of February. In the Middle Ages, it was considered a symbol of royalty and used to decorate English regalia. In the Old World, amethyst was considered one of the cardinal gems, in that it was one of the five gemstones considered precious above all others, until large deposits were found in Brazil.

Value
Until the 18th century, amethyst was included in the cardinal, or most valuable, gemstones (along with diamond, sapphire, ruby, and emerald), but since the discovery of extensive deposits in locations such as Brazil, it has lost most of its value. It is now considered a semiprecious stone.

Collectors look for depth of color, possibly with red flashes if cut conventionally. As amethyst is readily available in large structures, the value of the gem is not primarily defined by carat weight. This is different from most gemstones, since the carat weight typically exponentially increases the value of the stone. The biggest factor in the value of amethyst is the color displayed.

The highest-grade amethyst (called deep Russian) is exceptionally rare. When one is found, its value is dependent on the demand of collectors; however, the highest-grade sapphires or rubies are still orders of magnitude more expensive than amethyst.

Handling and care
The most suitable setting for gem amethyst is a prong or a bezel setting. The channel method must be used with caution.

Amethyst has a good hardness, and handling it with proper care will prevent any damage to the stone. Amethyst is sensitive to strong heat and may lose or change its colour when exposed to prolonged heat or light. Polishing the stone or cleaning it by ultrasonic or steamer must be done with caution.

title: Amethyst


text:
Albertosaurus

Albertosaurus (meaning "Alberta lizard") is a genus of large tyrannosaurid theropod dinosaur that lived in northwestern North America during the early to middle Maastrichtian age of the Late Cretaceous period, about 71 million years ago. The type species, A. sarcophagus, was apparently restricted in range to the modern-day Canadian province of Alberta, after which the genus is named, although an indeterminate species ("cf. Albertosaurus sp.") has been discovered in the Corral de Enmedio and Packard Formations of Mexico. Scientists disagree on the content of the genus and some recognize Gorgosaurus libratus as a second species.

As a tyrannosaurid, Albertosaurus was a bipedal predator with short arms, two-fingered hands, and a massive head with dozens of large, sharp teeth, a strong sense of smell, powerful binocular vision, and a bone crushing bite force. It may have even been the apex predator in its local ecosystem. While Albertosaurus was certainly large for a theropod, it was still much smaller than its larger and more famous relative Tyrannosaurus rex, growing up to 8 - 9 m in length and weighing 1.7 - 3.0 MT.

Since the first discovery in 1884, fossils of more than 30 individuals have been recovered that provide scientists with a more detailed knowledge of Albertosaurus anatomy than what is available for most other tyrannosaurids. The discovery of 26 individuals in one particular site provides evidence of gregarious behavior and allows for studies of ontogeny and population biology. These are near impossible with lesser-known dinosaurs because their remains are rarer and more fragmentary when compared to those of Albertosaurus.

Naming
Albertosaurus was named by Henry Fairfield Osborn in a one-page note at the end of his 1905 description of Tyrannosaurus rex. Its namesake is Alberta, the Canadian province established the very same year where the first remains were found. The generic name also incorporates the Greek word σαυρος/sauros, meaning "lizard", which is the most common suffix in dinosaur names. The type species is Albertosaurus sarcophagus and the specific name is derived from the Ancient Greek term σαρκοφάγος (sarkophagos), meaning "flesh-eating", and having the same etymology as the funeral container with which it shares its name, which is a combination of the Greek words σαρξ/sarx ("flesh") and φαγειν/phagein ("to eat"). More than 30 specimens of all ages are known to science.

Early discoveries
The type specimen is a partial skull collected on June 9, 1884 from an outcrop of the Horseshoe Canyon Formation alongside the Red Deer River in Alberta. It was recovered by an expedition of the Geological Survey of Canada, led by the famous geologist Joseph Burr Tyrrell. Due to a lack of specialised equipment, the almost complete skull could only be partially secured. In 1889, Tyrrell's colleague Thomas Chesmer Weston found an incomplete smaller skull associated with some skeletal material at a location nearby. The two skulls were assigned to the preexisting species Laelaps incrassatus by Edward Drinker Cope in 1892. Although the name Laelaps was preoccupied by a genus of mite and had been changed to Dryptosaurus in 1877 by Othniel Charles Marsh, Cope stubbornly refused to recognize the new name created by his archrival. However, Lawrence Lambe used the name Dryptosaurus incrassatus instead of Laelaps incrassatus when he described the remains in detail in 1903 and 1904, which was a combination first coined by Oliver Perry Hay in 1902.

Shortly later, Osborn pointed out that D. incrassatus was based on generic tyrannosaurid teeth, so the two Horseshoe Canyon skulls could not be confidently referred to that species. The Horseshoe Canyon skulls also differed markedly from the remains of D. aquilunguis, type species of Dryptosaurus, so Osborn gave them the new name Albertosaurus sarcophagus in 1905. He did not describe the remains in any great detail, citing Lambe's complete description the year before. Both specimens, the holotype CMN 5600 and the paratype CMN 5601, are stored in the Canadian Museum of Nature in Ottawa. By the early twenty-first century, some concerns had arisen that, due to the damaged state of the holotype, Albertosaurus might be a nomen dubium that could only be used for the type specimen itself because other fossils could not reliably be assigned to it. However, in 2010, Thomas Carr established that the holotype, the paratype, and comparable later finds all shared a single common unique trait, or autapomorphy. The possession of an enlarged pneumatic opening in the back rim of the side of the palatine bone proves that Albertosaurus is a valid taxon.

Dry Island bone bed
On August 11, 1910, American paleontologist Barnum Brown discovered the remains of a large group of Albertosaurus at another quarry alongside the Red Deer River. Because of the large number of bones and the limited time available, Brown's party did not collect every specimen, but made sure to collect remains from all of the individuals that they could identify in the bone bed. Among the bones deposited in the American Museum of Natural History collections in New York City are seven sets of right metatarsals, along with two isolated toe bones that did not match any of the metatarsals in size. This indicated the presence of at least nine individuals in the quarry. Palaeontologist Philip J. Currie of the Royal Tyrrell Museum of Palaeontology rediscovered the bonebed in 1997 and resumed fieldwork at the site, which is now located inside Dry Island Buffalo Jump Provincial Park. Further excavation from 1997 to 2005 turned up the remains of 13 more individuals of various ages, including a diminutive two-year-old and a very old individual estimated at over 10 m long. None of these individuals are known from complete skeletons and most are represented by remains in both museums. Excavations continued until 2008, when the minimum number of individuals present had been established at 12 (on the basis of preserved elements that occur only once in a skeleton) and at 26 if mirrored elements were counted when differing in size due to ontogeny. A total of 1,128 Albertosaurus bones had been secured, which is the largest concentration of large theropod fossils known from the Cretaceous.

Other discoveries
In 1911, Barnum Brown, during the second year of the American Museum of Natural History's operations in Alberta, uncovered a fragmentary partial Albertosaurus skull at the Red Deer River near Tolman Bridge (specimen AMNH 5222).

William Parks described a new species in 1928, Albertosaurus arctunguis, based on a partial skeleton lacking a skull that was excavated by Gus Lindblad and Ralph Hornell near the Red Deer River in 1923, but this species has been considered identical to A. sarcophagus since 1970. Parks' specimen (ROM 807) is housed in the Royal Ontario Museum in Toronto.

No Albertosaurus fossils were found from 1926 to 1972, but there has been an increase in findings since then. Apart from the Dry Island bonebed, six more skulls and skeletons have since been discovered in Alberta and are housed in various Canadian museums. Specimen RTMP 81.010.001 was found in 1978 by amateur paleontologist Maurice Stefanuk. RTMP 85.098.001 was found by Stefanuk on June 16, 1985. RTMP 86.64.001 was found in December 1985. RTMP 86.205.001 was found in 1986. RTMP 97.058.0001 was found in 1996 and then there is CMN 11315. Unfortunately, none of these skeletons were found with complete skulls. Fossils have also been reported from the American states of Montana, New Mexico, Wyoming, and Missouri, but they are doubted to be from A. sarcophagus and may not even belong to the genus Albertosaurus.

Two specimens from "cf Albertosaurus ".sp" have been found in Mexico (Packard Formation and Corral de Enmedio Formation).

Gorgosaurus libratus
In 1913, paleontologist Charles H. Sternberg recovered another tyrannosaurid skeleton from the slightly older Dinosaur Park Formation in Alberta. Lawrence Lambe named this dinosaur Gorgosaurus libratus in 1914. Other specimens were later found in Alberta and the US state of Montana. Finding no significant differences to separate the two taxa (due mostly to a lack of good Albertosaurus skull material), Dale Russell declared the name Gorgosaurus a junior synonym of Albertosaurus, which had been named first, and G. libratus was renamed Albertosaurus libratus in 1970. A species distinction was maintained because of the age difference. The addition extended the temporal range of the genus Albertosaurus earlier by several million years and its geographic range southwards by hundreds of kilometres.

In 2003, Philip J. Currie, benefiting from much more extensive finds and a general increase in anatomical knowledge of theropods, compared several tyrannosaurid skulls and came to the conclusion that the two species are more distinct than previously thought. As the two species are sister taxa, they are more closely related to each other than to any other species of tyrannosaurid. Recognizing this, Currie nevertheless recommended that Albertosaurus and Gorgosaurus be kept as separate genera, as he concluded that they were no more similar than Daspletosaurus and Tyrannosaurus, which are almost always separated. In addition to this, several albertosaurine specimens have been recovered from Alaska and New Mexico. Currie suggested that the Albertosaurus-Gorgosaurus situation may be clarified once these are fully described. Most authors have followed Currie's recommendation, but some have not.

Other species
In 1930, Anatoly Nikolaevich Riabinin named Albertosaurus pericolosus based on a tooth from China that probably belonged to Tarbosaurus. In 1932, Friedrich von Huene renamed Dryptosaurus incrassatus, not considered a nomen dubium by him, to Albertosaurus incrassatus. Because he had identified Gorgosaurus with Albertosaurus, in 1970, Russell also renamed Gorgosaurus sternbergi (Matthew & Brown 1922) into Albertosaurus sternbergi and Gorgosaurus lancensis (Gilmore 1946) into Albertosaurus lancensis. The former species is today seen as a juvenile form of Gorgosaurus libratus and the latter is seen as either identical to Tyrannosaurus or representing a separate genus, Nanotyrannus. In 1988, Gregory S. Paul based Albertosaurus megagracilis on a small tyrannosaurid skeleton, specimen LACM 28345, from the Hell Creek Formation of Montana. It was renamed Dinotyrannus in 1995, but is now thought to represent a juvenile Tyrannosaurus rex. Also in 1988, Paul renamed Alectrosaurus olseni (Gilmore 1933) into Albertosaurus olseni, but this has found no general acceptance. In 1989, Gorgosaurus novojilovi (Maleev 1955) was renamed by Bryn Mader and Robert Bradley as Albertosaurus novojilovi.

On two occasions, species based on valid Albertosaurus material were reassigned to a different genus, Deinodon. In 1922, William Diller Matthew renamed A. sarcophagus into Deinodon sarcophagus. In 1939, German paleontologist Oskar Kuhn renamed A. arctunguis into Deinodon arctunguis.

Description
Albertosaurus was a fairly large bipedal predator, but smaller than Tarbosaurus and Tyrannosaurus rex. Typical Albertosaurus adults measured up to 8 - 9 m long and weighed between 1.7 and 3.0 MT in body mass.

Albertosaurus shared a similar body appearance with all other tyrannosaurids, Gorgosaurus in particular. Typical for a theropod, Albertosaurus was bipedal and balanced its large, heavy head and torso with a long, muscular tail. However, tyrannosaurid forelimbs were extremely small for their body size and retained only two functional fingers, the second being longer than the first. The legs were long and ended in a four-toed foot on which the first toe, the hallux, was very short and did not reach the ground. The third toe was longer than the rest. Albertosaurus may have been able to reach walking speeds of 14–21 km/hour (8–13 mi/hour). At least for the younger individuals, a high running speed is plausible.

Two skin impressions from Albertosaurus are known, and both show scales. One patch is found associated with some gastralic ribs and the impression of a long, unknown bone, indicating that the patch is from the belly. The scales are pebbly and gradually become larger and somewhat hexagonal in shape. Also preserved are two larger feature scales, placed 4.5 cm apart from each other, making Albertosaurus, along with Carnotaurus, the only known theropods with preserved feature scales. Another skin impression is from an unknown part of the body. These scales are small, diamond-shaped, and arranged in rows.

Skull and teeth
The massive skull of Albertosaurus, which was perched on a muscular, short, S-shaped neck, was about 1 m long in the largest adults. Wide openings in the skull, called fenestrae, provided space for muscle attachment sites and sensory organs that reduced its overall weight. Its long jaws contained, both sides combined, 58 or more banana-shaped teeth. Larger tyrannosaurids possessed fewer teeth, but Gorgosaurus had 62. Unlike most theropods, Albertosaurus and other tyrannosaurids were heterodont, with teeth of different forms depending on their position in the mouth. The premaxillary teeth at the tip of the upper jaw, four per side, were much smaller than the rest, more closely packed, and D-shaped in cross section. Like with Tyrannosaurus rex, the maxillary (cheek) teeth of Albertosaurus were adapted in general form to resist lateral forces exerted by a struggling prey animal. The bite force of Albertosaurus was less formidable, however, with the maximum force, by the back teeth, reaching 3,413 Newtons. Above the eyes were short bony crests that may have been brightly coloured in life and possibly used, by males in particular, in courtship to attract a mate.

In 2001, William Abler observed that Albertosaurus tooth serrations resemble a crack in the tooth ending in a round void called an ampulla. Tyrannosaurid teeth were used as holdfasts for pulling flesh off a body, so when a tyrannosaur pulled back on a piece of meat, the tension could cause a purely crack-like serration to spread through the tooth. However, the presence of the ampulla distributed these forces over a larger surface area and lessened the risk of damage to the tooth under strain. The presence of incisions ending in voids has parallels in human engineering. Guitar makers use incisions ending in voids to, as Abler describes, "impart alternating regions of flexibility and rigidity" to wood that they work on. The use of a drill to create an "ampulla" of sorts and prevent the propagation of cracks through material is also used to protect aircraft surfaces. Abler demonstrated that a plexiglass bar with incisions called "kerfs" and drilled holes was more than 25% stronger than one with only regularly placed incisions. Unlike tyrannosaurs, more ancient predators, like phytosaurs and Dimetrodon, had no adaptations to prevent the crack-like serrations of their teeth from spreading when subjected to the forces of feeding.

Classification and systematics
Albertosaurus is a member of the theropod family Tyrannosauridae, specifically the subfamily Albertosaurinae. Its closest relative is the slightly older Gorgosaurus libratus (sometimes called Albertosaurus libratus; see below). These two species are the only described albertosaurines, but other undescribed species may exist. Thomas Holtz found Appalachiosaurus to be an albertosaurine in 2004, but his more recent unpublished work places it as a basal eotyrannosaurian just outside of Tyrannosauridae, in agreement with other authors.

The other major subfamily of tyrannosaurids is Tyrannosaurinae, which includes members like Daspletosaurus, Tarbosaurus, and Tyrannosaurus. Compared with the more robust tyrannosaurines, albertosaurines had slender builds, with proportionately smaller skulls and longer bones of the lower legs (tibia) and feet (metatarsals and phalanges). Below is the cladogram of Tyrannosauridae based on the phylogenetic analysis conducted by Loewen et al. in 2013.

Growth pattern
Most age categories of Albertosaurus are represented in the fossil record. Using bone histology, the age of an individual animal at the time of death can often be determined, allowing growth rates to be estimated and compared with other species. The youngest known Albertosaurus is a two-year-old discovered in the Dry Island bonebed, which would have weighed about 50 kilograms (110 lb) and measured slightly more than 2 m long. The 10 m specimen from the same quarry is 28 years old, the oldest and largest one known. When specimens of intermediate age and size are plotted on a graph, an S-shaped growth curve results, with the most rapid growth occurring in a four-year period ending around the sixteenth year of life, a pattern also seen in other tyrannosaurids. The growth rate during this phase was 122 kg per year, based on an adult weighing 1.3 tonnes. Other studies have suggested higher adult weights, which would affect the magnitude of the growth rate, but not the overall pattern. Tyrannosaurids similar in size to Albertosaurus had similar growth rates, although the much larger Tyrannosaurus rex grew at almost five times this rate (601 kg per year) at its peak. The end of the rapid growth phase suggests the onset of sexual maturity in Albertosaurus, although growth continued at a slower rate throughout the animals' lives. Sexual maturation while still actively growing appears to be a shared trait among small and large dinosaurs, as well as in large mammals like humans and elephants. This pattern of relatively early sexual maturation differs strikingly from the pattern in birds, which delay their sexual maturity until after they have finished growing.

During growth, thickening of the tooth morphology changed so much that, had the association of young and adult skeletons on the Dry Island bonebed not proven that they belonged to the same taxon, the teeth of juveniles would likely have been identified by statistical analysis as those of a different species.

Life history
Most known Albertosaurus individuals were aged 14 years or older at the time of death. Juvenile animals are rarely fossilized for several reasons, mainly preservation bias, where the smaller bones of younger animals were less likely to be preserved by fossilization than the larger bones of adults, and collection bias, where smaller fossils are less likely to be noticed by collectors in the field. Young Albertosaurus are relatively large for juvenile animals, but their remains are still rare in the fossil record when compared to adults. It has been suggested that this phenomenon is a consequence of life history, rather than bias, and that fossils of juvenile Albertosaurus are rare because they simply did not die as often as adults did.

A hypothesis of Albertosaurus life history postulates that hatchlings died in large numbers, but have not been preserved in the fossil record because of their small size and fragile construction. After just two years, juveniles were larger than any other predator in the region, aside from adult Albertosaurus, and more fleet-footed than most of their prey animals. This resulted in a dramatic decrease in their mortality rate and a corresponding rarity of fossil remains. Mortality rates doubled at age twelve, perhaps the result of the physiological demands of the rapid growth phase, and then doubled again with the onset of sexual maturity between the ages of fourteen and sixteen. This elevated mortality rate continued throughout adulthood, perhaps due to the high physiological demands of procreation, including stress and injuries received during intraspecific competition for mates and resources, and the eventual, ever-increasing effects of senescence. The higher mortality rate in adults may explain their more common preservation. Very large animals were rare because few individuals survived long enough to attain such size. High infant mortality rates, followed by reduced mortality among juveniles and a sudden increase in mortality after sexual maturity, with very few animals reaching maximum size, is a pattern observed in many modern large mammals, including elephants, African buffalo, and rhinoceros. The same pattern is also seen in other tyrannosaurids. The comparison with modern animals and other tyrannosaurids lends support to this life history hypothesis, but bias in the fossil record may still play a large role, especially since more than two-thirds of all Albertosaurus specimens are known from the exact same locality.

Pack behaviour
The Dry Island bonebed discovered by Barnum Brown and his crew contains the remains of 26 Albertosaurus, the most individuals found in one locality of any large Cretaceous theropod and the second-most of any large theropod dinosaur behind the Allosaurus assemblage at the Cleveland-Lloyd Dinosaur Quarry in Utah. The group seems to be composed of one very old adult, eight adults between 17 and 23 years old, seven sub-adults undergoing their rapid growth phases at between 12 and 16 years old, and six juveniles between the ages of 2 and 11 years old that had not yet reached the growth phase.

The near-absence of herbivore remains and the similar state of preservation common to the many individuals at the Albertosaurus bonebed quarry led Currie to conclude that the locality was not a predator trap, such as the La Brea Tar Pits in California, and that all of the preserved animals died at the same time. Currie claims this as evidence of pack behavior. Other scientists are skeptical, observing that the animals may have been driven together by a drought, flood, or other reasons.

There is plentiful evidence for gregarious behaviour among herbivorous dinosaurs, including ceratopsians and hadrosaurs. However, only rarely are so many dinosaurian predators found at the same site. Small theropods, like Deinonychus and Coelophysis, have been found in aggregations, as have larger predators, such as Allosaurus and Mapusaurus. There is some evidence of gregarious behaviour in other tyrannosaurids as well, as fragmentary remains of smaller individuals were found alongside "Sue", the Tyrannosaurus mounted in the Field Museum of Natural History in Chicago, and a bonebed in the Two Medicine Formation of Montana contains at least three specimens of Daspletosaurus preserved alongside several hadrosaurs. These findings may corroborate the evidence for social behaviour in Albertosaurus, although some or all of the above localities may represent temporary or unnatural aggregations. Others have speculated that, instead of social groups, at least some of these finds represent Komodo dragon-like mobbing of carcasses, where aggressive competition leads to some of the predators being killed and even cannibalized. The evidence of cannibalism was later reported in 2024 by Coppock and Currie.

Currie has also speculated on the pack-hunting habits of Albertosaurus. The leg proportions of the smaller individuals were comparable to those of ornithomimids, which were probably among the fastest dinosaurs. Younger Albertosaurus were probably equally fleet-footed or at least faster than their prey. Currie hypothesized that the younger members of the pack may have been responsible for driving their prey towards the adults, who were larger and more powerful, but also slower. Juveniles may also have had different lifestyles than adults, filling predator niches between the enormous adults and the smaller contemporaneous theropods, the largest of which were two orders of magnitude smaller than adult Albertosaurus in mass. A similar situation is observed in modern Komodo dragons, with hatchlings beginning life as small insectivores before growing to become the dominant predators on their islands. However, as the preservation of behaviour in the fossil record is exceedingly rare, these ideas cannot readily be tested. In 2010, Currie, though still favouring the hunting pack hypothesis, admitted that the concentration could have been brought about by other causes, such as a slowly rising water level during an extended flood.

Palaeopathology
In 2009, researchers hypothesized that smooth-edged holes found in the fossil jaws of tyrannosaurid dinosaurs, such as Albertosaurus, were caused by a parasite similar to Trichomonas gallinae, which infects birds. They suggested that tyrannosaurids transmitted the infection by biting each other and that the infection impaired their ability to eat.

In 2001, Bruce Rothschild and others published a study examining evidence for stress fractures and tendon avulsions in theropod dinosaurs and the implications for their behavior. They found that only one of the 319 Albertosaurus foot bones checked for stress fractures actually had them and none of the four hand bones did. The scientists found that stress fractures were "significantly" less common in Albertosaurus than in the carnosaur Allosaurus. ROM 807, the holotype of A. arctunguis (now referred to A. sarcophagus), had a 2.5 by 3.5 cm deep hole in the iliac blade, although the describer of the species did not recognize this as pathological. The specimen also contains some exostosis on the fourth left metatarsal. In 1970, two of the five Albertosaurus sarcophagus specimens with humeri were reported by Dale Russel as having pathological damage to them.

In 2010, the health of the Dry Island Albertosaurus assembly was reported upon. Most specimens showed no sign of disease. On three phalanges of the foot, strange bony spurs that consisted of abnormal ossifications of the tendons, so-called enthesophytes, were present, but their cause is unknown. Two ribs and a belly-rib showed signs of breaking and healing. One adult specimen had a left lower jaw showing a puncture wound and both healed and unhealed bite marks. The low number of abnormalities compares favourably with the health condition of a Majungasaurus population of which it was established, in 2007, that 19% of individuals showed bone pathologies.

Palaeoecology
Most fossils of Albertosaurus sarcophagus are known from the upper Horseshoe Canyon Formation in Alberta. These younger units of this geologic formation date to the early Maastrichtian age of the Late Cretaceous period, about 70 to 68 million years ago. Immediately below this formation is the Bearpaw Shale, a marine formation representing a section of the Western Interior Seaway. The Inland Sea was receding as the climate cooled and sea levels subsided towards the end of the Cretaceous, thus exposing land that had previously been underwater. It was not a smooth process, however, and the seaway would periodically rise to cover parts of the region throughout Horseshoe Canyon before finally receding altogether in the years after. Due to the changing sea levels, many different environments are represented in the Horseshoe Canyon Formation, including offshore and near-shore marine habitats and coastal habitats, such as lagoons, estuaries, and tidal flats. Numerous coal seams represent ancient peat swamps. Like most of the other vertebrate fossils from the formation, Albertosaurus remains are found in deposits laid down in the deltas and floodplains of large rivers during the later half of Horseshoe Canyon times.

The fauna of the Horseshoe Canyon Formation is well-known, as vertebrate fossils, including those of dinosaurs, are very common. Sharks, rays, sturgeons, bowfins, gars, and the gar-like Aspidorhynchus made up the fish fauna. Mammals included multituberculates and the marsupial Didelphodon. The saltwater plesiosaur Leurospondylus has been found in marine sediments in the Horseshoe Canyon, while freshwater environments were populated by turtles, Champsosaurus, and crocodilians like Leidyosuchus and Stangerochampsa. Dinosaurs dominate the fauna, especially hadrosaurs, which make up half of all dinosaurs known. These include the genera Edmontosaurus, Saurolophus, and Hypacrosaurus. Ceratopsians and ornithomimids were also very common, together making up another third of the known fauna. Along with much rarer ankylosaurians and pachycephalosaurs, all of these animals would have been prey for a diverse array of carnivorous theropods, including troodontids, dromaeosaurids, and caenagnathids. Intermingled with the Albertosaurus remains of the Dry Island bonebed, the bones of the small theropod Albertonykus were found. Adult Albertosaurus were the apex predators in their environment, with intermediate niches possibly filled by juvenile Albertosaurus.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Albertosaurus


text:
Assembly language

In computer programming, assembly language (alternatively assembler language or symbolic machine code),  often referred to simply as assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence between the instructions in the language and the architecture's machine code instructions. Assembly language usually has one statement per machine instruction (1:1), but constants, comments, assembler directives, symbolic labels of, e.g., memory locations, registers, and macros  are generally also supported.

The first assembly code in which a language is used to represent machine code instructions is found in Kathleen and Andrew Donald Booth's 1947 work, Coding for A.R.C.. Assembly code is converted into executable machine code by a utility program referred to as an assembler. The term "assembler" is generally attributed to Wilkes, Wheeler and Gill in their 1951 book The Preparation of Programs for an Electronic Digital Computer, who, however, used the term to mean "a program that assembles another program consisting of several sections into a single program". The conversion process is referred to as assembly, as in assembling the source code. The computational step when an assembler is processing a program is called assembly time.

Because assembly depends on the machine code instructions, each assembly language is specific to a particular computer architecture.

Sometimes there is more than one assembler for the same architecture, and sometimes an assembler is specific to an operating system or to particular operating systems. Most assembly languages do not provide specific syntax for operating system calls, and most assembly languages can be used universally with any operating system, as the language provides access to all the real capabilities of the processor, upon which all system call mechanisms ultimately rest. In contrast to assembly languages, most high-level programming languages are generally portable across multiple architectures but require interpreting or compiling, much more complicated tasks than assembling.

In the first decades of computing, it was commonplace for both systems programming and application programming to take place entirely in assembly language. While still irreplaceable for some purposes, the majority of programming is now conducted in higher-level interpreted and compiled languages. In "No Silver Bullet", Fred Brooks summarised the effects of the switch away from assembly language programming: "Surely the most powerful stroke for software productivity, reliability, and simplicity has been the progressive use of high-level languages for programming. Most observers credit that development with at least a factor of five in productivity, and with concomitant gains in reliability, simplicity, and comprehensibility."

Today, it is typical to use small amounts of assembly language code within larger systems implemented in a higher-level language, for performance reasons or to interact directly with hardware in ways unsupported by the higher-level language. For instance, just under 2% of version 4.9 of the Linux kernel source code is written in assembly; more than 97% is written in C.

Assembly language syntax
Assembly language uses a mnemonic to represent, e.g., each low-level machine instruction or opcode, each directive, typically also each architectural register, flag, etc. Some of the mnemonics may be built in and some user defined. Many operations require one or more operands in order to form a complete instruction. Most assemblers permit named constants, registers, and labels for program and memory locations, and can calculate expressions for operands. Thus, programmers are freed from tedious repetitive calculations and assembler programs are much more readable than machine code. Depending on the architecture, these elements may also be combined for specific instructions or addressing modes using offsets or other data as well as fixed addresses. Many assemblers offer additional mechanisms to facilitate program development, to control the assembly process, and to aid debugging.

Some are column oriented, with specific fields in specific columns; this was very common for machines using punched cards in the 1950s and early 1960s. Some assemblers have free-form syntax, with fields separated by delimiters, e.g., punctuation, white space. Some assemblers are hybrid, with, e.g., labels, in a specific column and other fields separated by delimiters; this became more common than column oriented syntax in the 1960s.

Terminology

 * A macro assembler is an assembler that includes a macroinstruction facility so that (parameterized) assembly language text can be represented by a name, and that name can be used to insert the expanded text into other code.
 * Open code refers to any assembler input outside of a macro definition.
 * A cross assembler (see also cross compiler) is an assembler that is run on a computer or operating system (the host system) of a different type from the system on which the resulting code is to run (the target system). Cross-assembling facilitates the development of programs for systems that do not have the resources to support software development, such as an embedded system or a microcontroller. In such a case, the resulting object code must be transferred to the target system, via read-only memory (ROM, EPROM, etc.), a programmer (when the read-only memory is integrated in the device, as in microcontrollers), or a data link using either an exact bit-by-bit copy of the object code or a text-based representation of that code (such as Intel hex or Motorola S-record).
 * A high-level assembler is a program that provides language abstractions more often associated with high-level languages, such as advanced control structures (IF/THEN/ELSE, DO CASE, etc.) and high-level abstract data types, including structures/records, unions, classes, and sets.
 * A microassembler is a program that helps prepare a microprogram to control the low level operation of a computer.
 * A meta-assembler is "a program that accepts the syntactic and semantic description of an assembly language, and generates an assembler for that language", or that accepts an assembler source file along with such a description and assembles the source file in accordance with that description. "Meta-Symbol" assemblers for the SDS 9 Series and SDS Sigma series of computers are meta-assemblers. Sperry Univac also provided a Meta-Assembler for the UNIVAC 1100/2200 series.
 * inline assembler (or embedded assembler) is assembler code contained within a high-level language program. This is most often used in systems programs which need direct access to the hardware.

Assembler
An assembler program creates object code by translating combinations of mnemonics and syntax for operations and addressing modes into their numerical equivalents. This representation typically includes an operation code ("opcode") as well as other control bits and data. The assembler also calculates constant expressions and resolves symbolic names for memory locations and other entities. The use of symbolic references is a key feature of assemblers, saving tedious calculations and manual address updates after program modifications. Most assemblers also include macro facilities for performing textual substitution – e.g., to generate common short sequences of instructions as inline, instead of called subroutines.

Some assemblers may also be able to perform some simple types of instruction set-specific optimizations. One concrete example of this may be the ubiquitous x86 assemblers from various vendors. Called jump-sizing, most of them are able to perform jump-instruction replacements (long jumps replaced by short or relative jumps) in any number of passes, on request. Others may even do simple rearrangement or insertion of instructions, such as some assemblers for RISC architectures that can help optimize a sensible instruction scheduling to exploit the CPU pipeline as efficiently as possible.

Assemblers have been available since the 1950s, as the first step above machine language and before high-level programming languages such as Fortran, Algol, COBOL and Lisp. There have also been several classes of translators and semi-automatic code generators with properties similar to both assembly and high-level languages, with Speedcode as perhaps one of the better-known examples.

There may be several assemblers with different syntax for a particular CPU or instruction set architecture. For instance, an instruction to add memory data to a register in a x86-family processor might be, in original Intel syntax, whereas this would be written   in the AT&T syntax used by the GNU Assembler. Despite different appearances, different syntactic forms generally generate the same numeric machine code. A single assembler may also have different modes in order to support variations in syntactic forms as well as their exact semantic interpretations (such as FASM-syntax, TASM-syntax, ideal mode, etc., in the special case of x86 assembly programming).

Number of passes
There are two types of assemblers based on how many passes through the source are needed (how many times the assembler reads the source) to produce the object file. In both cases, the assembler must be able to determine the size of each instruction on the initial passes in order to calculate the addresses of subsequent symbols. This means that if the size of an operation referring to an operand defined later depends on the type or distance of the operand, the assembler will make a pessimistic estimate when first encountering the operation, and if necessary, pad it with one or more "no-operation" instructions in a later pass or the errata. In an assembler with peephole optimization, addresses may be recalculated between passes to allow replacing pessimistic code with code tailored to the exact distance from the target.
 * One-pass assemblers process the source code once. For symbols used before they are defined, the assembler will emit "errata" after the eventual definition, telling the linker or the loader to patch the locations where the as yet undefined symbols had been used.
 * Multi-pass assemblers create a table with all symbols and their values in the first passes, then use the table in later passes to generate code.

The original reason for the use of one-pass assemblers was memory size and speed of assembly – often a second pass would require storing the symbol table in memory (to handle forward references), rewinding and rereading the program source on tape, or rereading a deck of cards or punched paper tape. Later computers with much larger memories (especially disc storage), had the space to perform all necessary processing without such re-reading. The advantage of the multi-pass assembler is that the absence of errata makes the linking process (or the program load if the assembler directly produces executable code) faster.

Example: in the following code snippet, a one-pass assembler would be able to determine the address of the backward reference BKWD when assembling statement S2, but would not be able to determine the address of the forward reference FWD when assembling the branch statement S1 ; indeed, FWD may be undefined. A two-pass assembler would determine both addresses in pass 1, so they would be known when generating code in pass 2. S1  B    FWD ... FWD  EQU * ... BKWD EQU * ... S2   B   BKWD

High-level assemblers
More sophisticated high-level assemblers provide language abstractions such as: See Language design below for more details.
 * High-level procedure/function declarations and invocations
 * Advanced control structures (IF/THEN/ELSE, SWITCH)
 * High-level abstract data types, including structures/records, unions, classes, and sets
 * Sophisticated macro processing (although available on ordinary assemblers since the late 1950s for, e.g., the IBM 700 series and IBM 7000 series, and since the 1960s for IBM System/360 (S/360), amongst other machines)
 * Object-oriented programming features such as classes, objects, abstraction, polymorphism, and inheritance

Assembly language
A program written in assembly language consists of a series of mnemonic processor instructions and meta-statements (known variously as declarative operations, directives, pseudo-instructions, pseudo-operations and pseudo-ops), comments and data. Assembly language instructions usually consist of an opcode mnemonic followed by an operand, which might be a list of data, arguments or parameters. Some instructions may be "implied", which means the data upon which the instruction operates is implicitly defined by the instruction itself—such an instruction does not take an operand. The resulting statement is translated by an assembler into machine language instructions that can be loaded into memory and executed.

For example, the instruction below tells an x86/IA-32 processor to move an immediate 8-bit value into a register. The binary code for this instruction is 10110 followed by a 3-bit identifier for which register to use. The identifier for the AL register is 000, so the following machine code loads the AL register with the data 01100001. 10110000 01100001 This binary computer code can be made more human-readable by expressing it in hexadecimal as follows. B0 61 Here,  means "Move a copy of the following value into AL", and   is a hexadecimal representation of the value 01100001, which is 97 in decimal. Assembly language for the 8086 family provides the mnemonic MOV (an abbreviation of move) for instructions such as this, so the machine code above can be written as follows in assembly language, complete with an explanatory comment if required, after the semicolon. This is much easier to read and to remember.

In some assembly languages (including this one) the same mnemonic, such as MOV, may be used for a family of related instructions for loading, copying and moving data, whether these are immediate values, values in registers, or memory locations pointed to by values in registers or by immediate (a.k.a. direct) addresses. Other assemblers may use separate opcode mnemonics such as L for "move memory to register", ST for "move register to memory", LR for "move register to register", MVI for "move immediate operand to memory", etc.

If the same mnemonic is used for different instructions, that means that the mnemonic corresponds to several different binary instruction codes, excluding data (e.g. the  in this example), depending on the operands that follow the mnemonic. For example, for the x86/IA-32 CPUs, the Intel assembly language syntax  represents an instruction that moves the contents of register AH into register AL. The hexadecimal form of this instruction is: 88 E0 The first byte, 88h, identifies a move between a byte-sized register and either another register or memory, and the second byte, E0h, is encoded (with three bit-fields) to specify that both operands are registers, the source is AH, and the destination is AL.

In a case like this where the same mnemonic can represent more than one binary instruction, the assembler determines which instruction to generate by examining the operands. In the first example, the operand  is a valid hexadecimal numeric constant and is not a valid register name, so only the   instruction can be applicable. In the second example, the operand  is a valid register name and not a valid numeric constant (hexadecimal, decimal, octal, or binary), so only the   instruction can be applicable.

Assembly languages are always designed so that this sort of lack of ambiguity is universally enforced by their syntax. For example, in the Intel x86 assembly language, a hexadecimal constant must start with a numeral digit, so that the hexadecimal number 'A' (equal to decimal ten) would be written as  or , not  , specifically so that it cannot appear to be the name of register AH. (The same rule also prevents ambiguity with the names of registers BH, CH, and DH, as well as with any user-defined symbol that ends with the letter H and otherwise contains only characters that are hexadecimal digits, such as the word "BEACH".)

Returning to the original example, while the x86 opcode 10110000 copies an 8-bit value into the AL register, 10110001  moves it into CL and 10110010  does so into DL. Assembly language examples for these follow. The syntax of MOV can also be more complex as the following examples show.

In each case, the MOV mnemonic is translated directly into one of the opcodes 88-8C, 8E, A0-A3, B0-BF, C6 or C7 by an assembler, and the programmer normally does not have to know or remember which.

Transforming assembly language into machine code is the job of an assembler, and the reverse can at least partially be achieved by a disassembler. Unlike high-level languages, there is a one-to-one correspondence between many simple assembly statements and machine language instructions. However, in some cases, an assembler may provide pseudoinstructions (essentially macros) which expand into several machine language instructions to provide commonly needed functionality. For example, for a machine that lacks a "branch if greater or equal" instruction, an assembler may provide a pseudoinstruction that expands to the machine's "set if less than" and "branch if zero (on the result of the set instruction)". Most full-featured assemblers also provide a rich macro language (discussed below) which is used by vendors and programmers to generate more complex code and data sequences. Since the information about pseudoinstructions and macros defined in the assembler environment is not present in the object program, a disassembler cannot reconstruct the macro and pseudoinstruction invocations but can only disassemble the actual machine instructions that the assembler generated from those abstract assembly-language entities. Likewise, since comments in the assembly language source file are ignored by the assembler and have no effect on the object code it generates, a disassembler is always completely unable to recover source comments.

Each computer architecture has its own machine language. Computers differ in the number and type of operations they support, in the different sizes and numbers of registers, and in the representations of data in storage. While most general-purpose computers are able to carry out essentially the same functionality, the ways they do so differ; the corresponding assembly languages reflect these differences.

Multiple sets of mnemonics or assembly-language syntax may exist for a single instruction set, typically instantiated in different assembler programs. In these cases, the most popular one is usually that supplied by the CPU manufacturer and used in its documentation.

Two examples of CPUs that have two different sets of mnemonics are the Intel 8080 family and the Intel 8086/8088. Because Intel claimed copyright on its assembly language mnemonics (on each page of their documentation published in the 1970s and early 1980s, at least), some companies that independently produced CPUs compatible with Intel instruction sets invented their own mnemonics. The Zilog Z80 CPU, an enhancement of the Intel 8080A, supports all the 8080A instructions plus many more; Zilog invented an entirely new assembly language, not only for the new instructions but also for all of the 8080A instructions. For example, where Intel uses the mnemonics MOV, MVI, LDA, STA, LXI, LDAX, STAX, LHLD, and SHLD for various data transfer instructions, the Z80 assembly language uses the mnemonic LD for all of them. A similar case is the NEC V20 and V30 CPUs, enhanced copies of the Intel 8086 and 8088, respectively. Like Zilog with the Z80, NEC invented new mnemonics for all of the 8086 and 8088 instructions, to avoid accusations of infringement of Intel's copyright. (It is questionable whether such copyrights can be valid, and later CPU companies such as AMD and Cyrix republished Intel's x86/IA-32 instruction mnemonics exactly with neither permission nor legal penalty.) It is doubtful whether in practice many people who programmed the V20 and V30 actually wrote in NEC's assembly language rather than Intel's; since any two assembly languages for the same instruction set architecture are isomorphic (somewhat like English and Pig Latin), there is no requirement to use a manufacturer's own published assembly language with that manufacturer's products.

Basic elements
There is a large degree of diversity in the way the authors of assemblers categorize statements and in the nomenclature that they use. In particular, some describe anything other than a machine mnemonic or extended mnemonic as a pseudo-operation (pseudo-op). A typical assembly language consists of 3 types of instruction statements that are used to define program operations:

 * Opcode mnemonics
 * Data definitions
 * Assembly directives

Opcode mnemonics and extended mnemonics
Instructions (statements) in assembly language are generally very simple, unlike those in high-level languages. Generally, a mnemonic is a symbolic name for a single executable machine language instruction (an opcode), and there is at least one opcode mnemonic defined for each machine language instruction. Each instruction typically consists of an operation or opcode plus zero or more operands. Most instructions refer to a single value or a pair of values. Operands can be immediate (value coded in the instruction itself), registers specified in the instruction or implied, or the addresses of data located elsewhere in storage. This is determined by the underlying processor architecture: the assembler merely reflects how this architecture works. Extended mnemonics are often used to specify a combination of an opcode with a specific operand, e.g., the System/360 assemblers use B as an extended mnemonic for BC with a mask of 15 and NOP ("NO OPeration" – do nothing for one step) for BC with a mask of 0.

Extended mnemonics are often used to support specialized uses of instructions, often for purposes not obvious from the instruction name. For example, many CPU's do not have an explicit NOP instruction, but do have instructions that can be used for the purpose. In 8086 CPUs the instruction xchg ax,ax is used for nop, with nop being a pseudo-opcode to encode the instruction xchg ax,ax. Some disassemblers recognize this and will decode the xchg ax,ax instruction as nop. Similarly, IBM assemblers for System/360 and System/370 use the extended mnemonics NOP and NOPR for BC and BCR with zero masks. For the SPARC architecture, these are known as synthetic instructions.

Some assemblers also support simple built-in macro-instructions that generate two or more machine instructions. For instance, with some Z80 assemblers the instruction ld hl,bc is recognized to generate ld l,c followed by ld h,b. These are sometimes known as pseudo-opcodes.

Mnemonics are arbitrary symbols; in 1985 the IEEE published Standard 694 for a uniform set of mnemonics to be used by all assemblers. The standard has since been withdrawn.

Data directives
There are instructions used to define data elements to hold data and variables. They define the type of data, the length and the alignment of data. These instructions can also define whether the data is available to outside programs (programs assembled separately) or only to the program in which the data section is defined. Some assemblers classify these as pseudo-ops.

Assembly directives
Assembly directives, also called pseudo-opcodes, pseudo-operations or pseudo-ops, are commands given to an assembler "directing it to perform operations other than assembling instructions". Directives affect how the assembler operates and "may affect the object code, the symbol table, the listing file, and the values of internal assembler parameters". Sometimes the term pseudo-opcode is reserved for directives that generate object code, such as those that generate data.

The names of pseudo-ops often start with a dot to distinguish them from machine instructions. Pseudo-ops can make the assembly of the program dependent on parameters input by a programmer, so that one program can be assembled in different ways, perhaps for different applications. Or, a pseudo-op can be used to manipulate presentation of a program to make it easier to read and maintain. Another common use of pseudo-ops is to reserve storage areas for run-time data and optionally initialize their contents to known values.

Symbolic assemblers let programmers associate arbitrary names (labels or symbols) with memory locations and various constants. Usually, every constant and variable is given a name so instructions can reference those locations by name, thus promoting self-documenting code. In executable code, the name of each subroutine is associated with its entry point, so any calls to a subroutine can use its name. Inside subroutines, GOTO destinations are given labels. Some assemblers support local symbols which are often lexically distinct from normal symbols (e.g., the use of "10$" as a GOTO destination).

Some assemblers, such as NASM, provide flexible symbol management, letting programmers manage different namespaces, automatically calculate offsets within data structures, and assign labels that refer to literal values or the result of simple computations performed by the assembler. Labels can also be used to initialize constants and variables with relocatable addresses.

Assembly languages, like most other computer languages, allow comments to be added to program source code that will be ignored during assembly. Judicious commenting is essential in assembly language programs, as the meaning and purpose of a sequence of binary machine instructions can be difficult to determine. The "raw" (uncommented) assembly language generated by compilers or disassemblers is quite difficult to read when changes must be made.

Macros
Many assemblers support predefined macros, and others support programmer-defined (and repeatedly re-definable) macros involving sequences of text lines in which variables and constants are embedded. The macro definition is most commonly a mixture of assembler statements, e.g., directives, symbolic machine instructions, and templates for assembler statements. This sequence of text lines may include opcodes or directives. Once a macro has been defined its name may be used in place of a mnemonic. When the assembler processes such a statement, it replaces the statement with the text lines associated with that macro, then processes them as if they existed in the source code file (including, in some assemblers, expansion of any macros existing in the replacement text). Macros in this sense date to IBM autocoders of the 1950s.

Macro assemblers typically have directives to, e.g., define macros, define variables, set variables to the result of an arithmetic, logical or string expression, iterate, conditionally generate code. Some of those directives may be restricted to use within a macro definition, e.g., MEXIT in HLASM, while others may be permitted within open code (outside macro definitions), e.g., AIF and COPY in HLASM.

In assembly language, the term "macro" represents a more comprehensive concept than it does in some other contexts, such as the pre-processor in the C programming language, where its #define directive typically is used to create short single line macros. Assembler macro instructions, like macros in PL/I and some other languages, can be lengthy "programs" by themselves, executed by interpretation by the assembler during assembly.

Since macros can have 'short' names but expand to several or indeed many lines of code, they can be used to make assembly language programs appear to be far shorter, requiring fewer lines of source code, as with higher level languages. They can also be used to add higher levels of structure to assembly programs, optionally introduce embedded debugging code via parameters and other similar features.

Macro assemblers often allow macros to take parameters. Some assemblers include quite sophisticated macro languages, incorporating such high-level language elements as optional parameters, symbolic variables, conditionals, string manipulation, and arithmetic operations, all usable during the execution of a given macro, and allowing macros to save context or exchange information. Thus a macro might generate numerous assembly language instructions or data definitions, based on the macro arguments. This could be used to generate record-style data structures or "unrolled" loops, for example, or could generate entire algorithms based on complex parameters. For instance, a "sort" macro could accept the specification of a complex sort key and generate code crafted for that specific key, not needing the run-time tests that would be required for a general procedure interpreting the specification. An organization using assembly language that has been heavily extended using such a macro suite can be considered to be working in a higher-level language since such programmers are not working with a computer's lowest-level conceptual elements. Underlining this point, macros were used to implement an early virtual machine in SNOBOL4 (1967), which was written in the SNOBOL Implementation Language (SIL), an assembly language for a virtual machine. The target machine would translate this to its native code using a macro assembler. This allowed a high degree of portability for the time.

Macros were used to customize large scale software systems for specific customers in the mainframe era and were also used by customer personnel to satisfy their employers' needs by making specific versions of manufacturer operating systems. This was done, for example, by systems programmers working with IBM's Conversational Monitor System / Virtual Machine (VM/CMS) and with IBM's "real time transaction processing" add-ons, Customer Information Control System CICS, and ACP/TPF, the airline/financial system that began in the 1970s and still runs many large computer reservation systems (CRS) and credit card systems today.

It is also possible to use solely the macro processing abilities of an assembler to generate code written in completely different languages, for example, to generate a version of a program in COBOL using a pure macro assembler program containing lines of COBOL code inside assembly time operators instructing the assembler to generate arbitrary code. IBM OS/360 uses macros to perform system generation. The user specifies options by coding a series of assembler macros. Assembling these macros generates a job stream to build the system, including job control language and utility control statements.

This is because, as was realized in the 1960s, the concept of "macro processing" is independent of the concept of "assembly", the former being in modern terms more word processing, text processing, than generating object code. The concept of macro processing appeared, and appears, in the C programming language, which supports "preprocessor instructions" to set variables, and make conditional tests on their values. Unlike certain previous macro processors inside assemblers, the C preprocessor is not Turing-complete because it lacks the ability to either loop or "go to", the latter allowing programs to loop.

Despite the power of macro processing, it fell into disuse in many high level languages (major exceptions being C, C++ and PL/I) while remaining a perennial for assemblers.

Macro parameter substitution is strictly by name: at macro processing time, the value of a parameter is textually substituted for its name. The most famous class of bugs resulting was the use of a parameter that itself was an expression and not a simple name when the macro writer expected a name. In the macro:

foo: macro a load a*b

the intention was that the caller would provide the name of a variable, and the "global" variable or constant b would be used to multiply "a". If foo is called with the parameter, the macro expansion of   occurs. To avoid any possible ambiguity, users of macro processors can parenthesize formal parameters inside macro definitions, or callers can parenthesize the input parameters.

Support for structured programming
Packages of macros have been written providing structured programming elements to encode execution flow. The earliest example of this approach was in the Concept-14 macro set, originally proposed by Harlan Mills (March 1970), and implemented by Marvin Kessler at IBM's Federal Systems Division, which provided IF/ELSE/ENDIF and similar control flow blocks for OS/360 assembler programs. This was a way to reduce or eliminate the use of GOTO operations in assembly code, one of the main factors causing spaghetti code in assembly language. This approach was widely accepted in the early 1980s (the latter days of large-scale assembly language use). IBM's High Level Assembler Toolkit includes such a macro package.

A curious design was A-Natural, a "stream-oriented" assembler for 8080/Z80, processors from Whitesmiths Ltd. (developers of the Unix-like Idris operating system, and what was reported to be the first commercial C compiler). The language was classified as an assembler because it worked with raw machine elements such as opcodes, registers, and memory references; but it incorporated an expression syntax to indicate execution order. Parentheses and other special symbols, along with block-oriented structured programming constructs, controlled the sequence of the generated instructions. A-natural was built as the object language of a C compiler, rather than for hand-coding, but its logical syntax won some fans.

There has been little apparent demand for more sophisticated assemblers since the decline of large-scale assembly language development. In spite of that, they are still being developed and applied in cases where resource constraints or peculiarities in the target system's architecture prevent the effective use of higher-level languages.

Assemblers with a strong macro engine allow structured programming via macros, such as the switch macro provided with the Masm32 package (this code is a complete program):

Historical perspective
Assembly languages were not available at the time when the stored-program computer was introduced. Kathleen Booth "is credited with inventing assembly language" based on theoretical work she began in 1947, while working on the ARC2 at Birkbeck, University of London following consultation by Andrew Booth (later her husband) with mathematician John von Neumann and physicist Herman Goldstine at the Institute for Advanced Study.

In late 1948, the Electronic Delay Storage Automatic Calculator (EDSAC) had an assembler (named "initial orders") integrated into its bootstrap program. It used one-letter mnemonics developed by David Wheeler, who is credited by the IEEE Computer Society as the creator of the first "assembler". Reports on the EDSAC introduced the term "assembly" for the process of combining fields into an instruction word. SOAP (Symbolic Optimal Assembly Program) was an assembly language for the IBM 650 computer written by Stan Poley in 1955.

Assembly languages eliminate much of the error-prone, tedious, and time-consuming first-generation programming needed with the earliest computers, freeing programmers from tedium such as remembering numeric codes and calculating addresses. They were once widely used for all sorts of programming. However, by the late 1950s, their use had largely been supplanted by higher-level languages, in the search for improved programming productivity. Today, assembly language is still used for direct hardware manipulation, access to specialized processor instructions, or to address critical performance issues. Typical uses are device drivers, low-level embedded systems, and real-time systems (see ).

Numerous programs have been written entirely in assembly language. The Burroughs MCP (1961) was the first computer for which an operating system was not developed entirely in assembly language; it was written in Executive Systems Problem Oriented Language (ESPOL), an Algol dialect. Many commercial applications were written in assembly language as well, including a large amount of the IBM mainframe software written by large corporations. COBOL, FORTRAN and some PL/I eventually displaced much of this work, although a number of large organizations retained assembly-language application infrastructures well into the 1990s.

Assembly language has long been the primary development language for 8-bit home computers such as the Apple II, Atari 8-bit computers, MSX, ZX Spectrum, and Commodore 64. Interpreted BASIC dialects on these systems offer insufficient execution speed and insufficient facilities to take full advantage of the available hardware. These systems have severe resource constraints, idiosyncratic memory and display architectures, and provide limited system services. There are also few high-level language compilers suitable for microcomputer use. Similarly, assembly language is the default choice for 8-bit consoles such as the Atari 2600 and Nintendo Entertainment System.

Key software for IBM PC compatibles was written in assembly language, such as MS-DOS, Turbo Pascal, and the Lotus 1-2-3 spreadsheet. As computer speed grew exponentially, assembly language became a tool for speeding up parts of programs, such as the rendering of Doom, rather than a dominant development language. In the 1990s, assembly language was used to get performance out of systems such as the Sega Saturn and as the primary language for arcade hardware based on the TMS34010 integrated CPU/GPU such as Mortal Kombat and NBA Jam.

Current usage
There has been debate over the usefulness and performance of assembly language relative to high-level languages.

Although assembly language has specific niche uses where it is important (see below), there are other tools for optimization.

, the TIOBE index of programming language popularity ranks assembly language at 11, ahead of Visual Basic, for example. Assembler can be used to optimize for speed or optimize for size. In the case of speed optimization, modern optimizing compilers are claimed to render high-level languages into code that can run as fast as hand-written assembly, despite the counter-examples that can be found. The complexity of modern processors and memory sub-systems makes effective optimization increasingly difficult for compilers, as well as for assembly programmers. Moreover, increasing processor performance has meant that most CPUs sit idle most of the time, with delays caused by predictable bottlenecks such as cache misses, I/O operations and paging. This has made raw code execution speed a non-issue for many programmers.

There are some situations in which developers might choose to use assembly language:

 * Writing code for systems with that have limited high-level language options such as the Atari 2600, Commodore 64, and graphing calculators. Programs for these computers of the 1970s and 1980s are often written in the context of demoscene or retrogaming subcultures.
 * Code that must interact directly with the hardware, for example in device drivers and interrupt handlers.
 * In an embedded processor or DSP, high-repetition interrupts require the shortest number of cycles per interrupt, such as an interrupt that occurs 1000 or 10000 times a second.
 * Programs that need to use processor-specific instructions not implemented in a compiler. A common example is the bitwise rotation instruction at the core of many encryption algorithms, as well as querying the parity of a byte or the 4-bit carry of an addition.
 * A stand-alone executable of compact size is required that must execute without recourse to the run-time components or libraries associated with a high-level language. Examples have included firmware for telephones, automobile fuel and ignition systems, air-conditioning control systems, security systems, and sensors.
 * Programs with performance-sensitive inner loops, where assembly language provides optimization opportunities that are difficult to achieve in a high-level language. For example, linear algebra with BLAS or discrete cosine transformation (e.g. SIMD assembly version from x264 ).
 * Programs that create vectorized functions for programs in higher-level languages such as C. In the higher-level language this is sometimes aided by compiler intrinsic functions which map directly to SIMD mnemonics, but nevertheless result in a one-to-one assembly conversion specific for the given vector processor.
 * Real-time programs such as simulations, flight navigation systems, and medical equipment. For example, in a fly-by-wire system, telemetry must be interpreted and acted upon within strict time constraints. Such systems must eliminate sources of unpredictable delays, which may be created by (some) interpreted languages, automatic garbage collection, paging operations, or preemptive multitasking. However, some higher-level languages incorporate run-time components and operating system interfaces that can introduce such delays. Choosing assembly or lower-level languages for such systems gives programmers greater visibility and control over processing details.
 * Cryptographic algorithms that must always take strictly the same time to execute, preventing timing attacks.
 * Video encoders and decoders such as rav1e (an encoder for AV1) and dav1d (the reference decoder for AV1) contain assembly to leverage AVX2 and ARM Neon instructions when available.
 * Modify and extend legacy code written for IBM mainframe computers.
 * Situations where complete control over the environment is required, in extremely high-security situations where nothing can be taken for granted.
 * Computer viruses, bootloaders, certain device drivers, or other items very close to the hardware or low-level operating system.
 * Instruction set simulators for monitoring, tracing and debugging where additional overhead is kept to a minimum.
 * Situations where no high-level language exists, on a new or specialized processor for which no cross compiler is available.
 * Reverse engineering and modifying program files such as:
 * existing binaries that may or may not have originally been written in a high-level language, for example when trying to recreate programs for which source code is not available or has been lost, or cracking copy protection of proprietary software.
 * Video games (also termed ROM hacking), which is possible via several methods. The most widely employed method is altering program code at the assembly language level.

Assembly language is still taught in most computer science and electronic engineering programs. Although few programmers today regularly work with assembly language as a tool, the underlying concepts remain important. Such fundamental topics as binary arithmetic, memory allocation, stack processing, character set encoding, interrupt processing, and compiler design would be hard to study in detail without a grasp of how a computer operates at the hardware level. Since a computer's behavior is fundamentally defined by its instruction set, the logical way to learn such concepts is to study an assembly language. Most modern computers have similar instruction sets. Therefore, studying a single assembly language is sufficient to learn: I) the basic concepts; II) to recognize situations where the use of assembly language might be appropriate; and III) to see how efficient executable code can be created from high-level languages.

Typical applications

 * Assembly language is typically used in a system's boot code, the low-level code that initializes and tests the system hardware prior to booting the operating system and is often stored in ROM. (BIOS on IBM-compatible PC systems and CP/M is an example.)
 * Assembly language is often used for low-level code, for instance for operating system kernels, which cannot rely on the availability of pre-existing system calls and must indeed implement them for the particular processor architecture on which the system will be running.
 * Some compilers translate high-level languages into assembly first before fully compiling, allowing the assembly code to be viewed for debugging and optimization purposes.
 * Some compilers for relatively low-level languages, such as Pascal or C, allow the programmer to embed assembly language directly in the source code (so called inline assembly). Programs using such facilities can then construct abstractions using different assembly language on each hardware platform. The system's portable code can then use these processor-specific components through a uniform interface.
 * Assembly language is useful in reverse engineering. Many programs are distributed only in machine code form which is straightforward to translate into assembly language by a disassembler, but more difficult to translate into a higher-level language through a decompiler. Tools such as the Interactive Disassembler make extensive use of disassembly for such a purpose. This technique is used by hackers to crack commercial software, and competitors to produce software with similar results from competing companies.
 * Assembly language is used to enhance speed of execution, especially in early personal computers with limited processing power and RAM.
 * Assemblers can be used to generate blocks of data, with no high-level language overhead, from formatted and commented source code, to be used by other code.

title: Assembly language


text:
Ambrosia

In the ancient Greek myths, ambrosia (, ἀμβροσία 'immortality') is the food or drink of the Greek gods, and is often depicted as conferring longevity or immortality upon whoever consumed it. It was brought to the gods in Olympus by doves and served either by Hebe or by Ganymede at the heavenly feast.

Ancient art sometimes depicted ambrosia as distributed by the nymph named Ambrosia, a nurse of Dionysus.

Definition
Ambrosia is very closely related to the gods' other form of sustenance, nectar. The two terms may not have originally been distinguished; though in Homer's poems nectar is usually the drink and ambrosia the food of the gods; it was with ambrosia that Hera "cleansed all defilement from her lovely flesh", and with ambrosia Athena prepared Penelope in her sleep, so that when she appeared for the final time before her suitors, the effects of years had been stripped away, and they were inflamed with passion at the sight of her. On the other hand, in Alcman, nectar is the food, and in Sappho and Anaxandrides, ambrosia is the drink. A character in Aristophanes' Knights says, "I dreamed the goddess poured ambrosia over your head—out of a ladle." Both descriptions could be correct, as ambrosia could be a liquid considered a food (such as honey).

The consumption of ambrosia was typically reserved for divine beings. Upon his assumption into immortality on Olympus, Heracles is given ambrosia by Athena, while the hero Tydeus is denied the same thing when the goddess discovers him eating human brains. In one version of the myth of Tantalus, part of Tantalus' crime is that after tasting ambrosia himself, he attempts to steal some to give to other mortals. Those who consume ambrosia typically have ichor, not blood, in their veins.

Both nectar and ambrosia are fragrant, and may be used as perfume: in the Odyssey Menelaus and his men are disguised as seals in untanned seal skins, "and the deadly smell of the seal skins vexed us sore; but the goddess saved us; she brought ambrosia and put it under our nostrils." Homer speaks of ambrosial raiment, ambrosial locks of hair, even the gods' ambrosial sandals.

Among later writers, ambrosia has been so often used with generic meanings of "delightful liquid" that such late writers as Athenaeus, Paulus and Dioscurides employ it as a technical term in contexts of cookery, medicine, and botany. Pliny used the term in connection with different plants, as did early herbalists.

Additionally, some modern ethnomycologists, such as Danny Staples, identify ambrosia with the hallucinogenic mushroom Amanita muscaria: "it was the food of the gods, their ambrosia, and nectar was the pressed sap of its juices", Staples asserts.

W. H. Roscher thinks that both nectar and ambrosia were kinds of honey, in which case their power of conferring immortality would be due to the supposed healing and cleansing powers of honey, and because fermented honey (mead) preceded wine as an entheogen in the Aegean world; on some Minoan seals, goddesses were represented with bee faces (compare Merope and Melissa).

Etymology
The concept of an immortality drink is attested in at least two ancient Indo-European languages: Greek and Sanskrit. The Greek ἀμβροσία (ambrosia) is semantically linked to the Sanskrit (amṛta) as both words denote a drink or food that gods use to achieve immortality. The two words appear to be derived from the same Indo-European form *ṇ-mṛ-tós, "un-dying" (n-: negative prefix from which the prefix a- in both Greek and Sanskrit are derived; mṛ: zero grade of *mer-, "to die"; and -to-: adjectival suffix). A semantically similar etymology exists for nectar, the beverage of the gods (Greek: νέκταρ néktar) presumed to be a compound of the PIE roots *nek-, "death", and -*tar, "overcoming".

Other examples in mythology

 * In one version of the story of the birth of Achilles, Thetis anoints the infant with ambrosia and passes the child through the fire to make him immortal but Peleus, appalled, stops her, leaving only his heel unimmortalised (Argonautica 4.869–879).
 * In the Iliad xvi, Apollo washes the black blood from the corpse of Sarpedon and anoints it with ambrosia, readying it for its dreamlike return to Sarpedon's native Lycia. Similarly, Thetis anoints the corpse of Patroclus in order to preserve it. Ambrosia and nectar are depicted as unguents (xiv. 170; xix. 38).
 * In the Odyssey, Calypso is described as having "spread a table with ambrosia and set it by Hermes, and mixed the rosy-red nectar." It is ambiguous whether he means the ambrosia itself is rosy-red, or if he is describing a rosy-red nectar Hermes drinks along with the ambrosia.  Later, Circe mentions to Odysseus that a flock of doves are the bringers of ambrosia to Olympus.
 * In the Odyssey (ix.345–359), Polyphemus likens the wine given to him by Odysseus to ambrosia and nectar.
 * One of the impieties of Tantalus, according to Pindar, was that he offered to his guests the ambrosia of the Deathless Ones, a theft akin to that of Prometheus, Karl Kerenyi noted (in Heroes of the Greeks).
 * In the Homeric hymn to Aphrodite, the goddess uses "ambrosial bridal oil that she had ready perfumed."
 * In the story of Eros and Psyche as told by Apuleius, Psyche is given ambrosia upon her completion of the quests set by Aphrodite and her acceptance on Olympus. After she partakes, she and Eros are wed as gods.
 * In the Aeneid, Aeneas encounters his mother in an alternate, or illusory form. When she became her godly form "Her hair's ambrosia breathed a holy fragrance."

Ambrosia (nymph)
Lycurgus, king of Thrace, forbade the cult of Dionysus, whom he drove from Thrace, and attacked the gods' entourage when they celebrated the god. Among them was Ambrosia, who turned herself into a grapevine to hide from his wrath. Dionysus, enraged by the king's actions, drove him mad. In his fit of insanity he killed his son, whom he mistook for a stock of ivy, and then himself.

title: Ambrosia