Number
int64
1
7.61k
Text
stringlengths
2
3.11k
2,001
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...
2,002
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 , rewinding and rereading the program source on tape, or rereading a deck of cards or punched paper tape. Later computers with much larger memories , had th...
2,003
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 a...
2,004
More sophisticated high-level assemblers provide language abstractions such as:
2,005
See Language design below for more details.
2,006
A program written in assembly language consists of a series of mnemonic processor instructions and meta-statements , 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"...
2,007
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 th...
2,008
This binary computer code can be made more human-readable by expressing it in hexadecimal as follows.
2,009
Here, B0 means 'Move a copy of the following value into AL, and 61 is a hexadecimal representation of the value 01100001, which is 97 in decimal. Assembly language for the 8086 family provides the mnemonic MOV for instructions such as this, so the machine code above can be written as follows in assembly language, comp...
2,010
In some assembly languages 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 addresses. Other assemblers may use separate...
2,011
If the same mnemonic is used for different instructions, that means that the mnemonic corresponds to several different binary instruction codes, excluding data , depending on the operands that follow the mnemonic. For example, for the x86/IA-32 CPUs, the Intel assembly language syntax MOV AL, AH represents an instruct...
2,012
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 to specify that both operands are registers, the source is AH, and the destination is AL.
2,013
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 61h is a valid hexadecimal numeric constant and is not a valid register name, so only the B0 instruction can be...
2,014
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' would be written as 0Ah or 0AH, not AH, specifically so tha...
2,015
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.
2,016
The syntax of MOV can also be more complex as the following examples show.
2,017
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.
2,018
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 assem...
2,019
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...
2,020
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.
2,021
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 , some companies that independently produced CPUs compatible with Intel instruction sets invented their own mnemonics. The Zilog Z80 CPU,...
2,022
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 . A typical assembly language consists of 3 types of instruction statement...
2,023
Instructions 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 , and there is at least one opcode mnemonic defined for each machine language instruction. Each instruction typically consists...
2,024
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, wi...
2,025
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.
2,026
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.
2,027
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 or only to the program in which the data section is defined. Some assemblers classify...
2,028
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 o...
2,029
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 manipul...
2,030
Symbolic assemblers let programmers associate arbitrary names 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...
2,031
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 initializ...
2,032
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...
2,033
Many assemblers support predefined macros, and others support programmer-defined 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 ...
2,034
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 p...
2,035
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 ...
2,036
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, option...
2,037
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,...
2,038
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 Conversat...
2,039
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 assembl...
2,040
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 s...
2,041
Despite the power of macro processing, it fell into disuse in many high level languages while remaining a perennial for assemblers.
2,042
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:
2,043
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 a-c, the macro expansion of load a-c*b occurs. To avoid any possible ambiguity, users of macro processors can parenthesize formal parameters...
2,044
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 , and implemented by Marvin Kessler at IBM's Federal Systems Division, which provided IF/ELSE/ENDIF and simi...
2,045
A curious design was A-Natural, a "stream-oriented" assembler for 8080/Z80, processors from Whitesmiths Ltd. . 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. ...
2,046
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 highe...
2,047
Assemblers with a strong macro engine allow structured programming via macros, such as the switch macro provided with the Masm32 package :
2,048
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 with mathemati...
2,049
In late 1948, the Electronic Delay Storage Automatic Calculator had an assembler 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...
2,050
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 19...
2,051
Numerous programs have been written entirely in assembly language. The Burroughs MCP 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 , an Algol dialect. Many commercial applications were written in assem...
2,052
Assembly language has long been the primary development language for 8-bit home computers such Atari 8-bit family, Apple II, 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. Th...
2,053
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...
2,054
There has been debate over the usefulness and performance of assembly language relative to high-level languages.
2,055
Although assembly language has specific niche uses where it is important , there are other tools for optimization.
2,056
As of July 2017, 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 tha...
2,057
There are some situations in which developers might choose to use assembly language:
2,058
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 encod...
2,059
It makes use of elaborative encoding, retrieval cues and imagery as specific tools to encode information in a way that allows for efficient storage and retrieval. It aids original information in becoming associated with something more accessible or meaningful—which in turn provides better retention of the information.
2,060
Commonly encountered mnemonics are often used for lists and in auditory form such as short poems, acronyms, initialisms or memorable phrases. They can also be used for other types of information and in visual or kinesthetic forms. Their use is based on the observation that the human mind more easily remembers spatial, ...
2,061
Ancient Greeks and Romans distinguished between two types of memory: the "natural" memory and the "artificial" memory. The former is inborn and is the one that everyone uses instinctively. The latter in contrast has to be trained and developed through the learning and practice of a variety of mnemonic techniques.
2,062
Mnemonic systems are techniques or strategies consciously used to improve memory. They help use information already stored in long-term memory to make memorization an easier task.
2,063
Mnemonic is derived from the Ancient Greek word μνημονικός which means 'of memory' or 'relating to memory'. It is related to Mnemosyne, the name of the goddess of memory in Greek mythology. Both of these words are derived from μνήμη , 'remembrance, memory'. Mnemonics in antiquity were most often considered in the cont...
2,064
The general name of mnemonics, or memoria technica, was the name applied to devices for aiding the memory, to enable the mind to reproduce a relatively unfamiliar idea, and especially a series of dissociated ideas, by connecting it, or them, in some artificial whole, the parts of which are mutually suggestive. Mnemonic...
2,065
Philosopher Charmadas was famous for his outstanding memory and for his ability to memorize whole books and then recite them.
2,066
In later times, the poet Simonides was credited for development of these techniques, perhaps for no reason other than that the power of his memory was famous. Cicero, who attaches considerable importance to the art, but more to the principle of order as the best help to memory, speaks of Carneades of Athens and Metrod...
2,067
The Greek and the Roman system of mnemonics was founded on the use of mental places and signs or pictures, known as "topical" mnemonics. The most usual method was to choose a large house, of which the apartments, walls, windows, statues, furniture, etc., were each associated with certain names, phrases, events or ideas...
2,068
In accordance with this system, if it were desired to fix a historic date in memory, it was localised in an imaginary town divided into a certain number of districts, each with ten houses, each house with ten rooms, and each room with a hundred quadrates or memory-places, partly on the floor, partly on the four walls, ...
2,069
Among the voluminous writings of Roger Bacon is a tractate De arte memorativa. Ramon Llull devoted special attention to mnemonics in connection with his ars generalis. The first important modification of the method of the Romans was that invented by the German poet Conrad Celtes, who, in his Epitoma in utramque Ciceron...
2,070
About the end of the 16th century, Lambert Schenkel , who taught mnemonics in France, Italy and Germany, similarly surprised people with his memory. He was denounced as a sorcerer by the University of Louvain, but in 1593 he published his tractate De memoria at Douai with the sanction of that celebrated theological fac...
2,071
In 1648 Stanislaus Mink von Wennsshein revealed what he called the "most fertile secret" in mnemonics—using consonants for figures, thus expressing numbers by words , in order to create associations more readily remembered. The philosopher Gottfried Wilhelm Leibniz adopted an alphabet very similar to that of Wennsshein...
2,072
Wennsshein's method was adopted with slight changes afterward by the majority of subsequent "original" systems. It was modified and supplemented by Richard Grey , a priest who published a Memoria technica in 1730. The principal part of Grey's method is briefly this:
2,073
Wennsshein's method is comparable to a Hebrew system by which letters also stand for numerals, and therefore words for dates.
2,074
To assist in retaining the mnemonical words in the memory, they were formed into memorial lines. Such strange words in difficult hexameter scansion, are by no means easy to memorise. The vowel or consonant, which Grey connected with a particular figure, was chosen arbitrarily.
2,075
A later modification was made in 1806 Gregor von Feinaigle, a German monk from Salem near Constance. While living and working in Paris, he expounded a system of mnemonics in which the numerical figures are represented by letters chosen due to some similarity to the figure or an accidental connection with it. This alph...
2,076
Other mnemonists later published simplified forms, as the more complicated mnemonics were generally abandoned. Methods founded chiefly on the so-called laws of association were taught with some success in Germany.
2,077
A wide range of mnemonics are used for several purposes. The most commonly used mnemonics are those for lists, numerical sequences, foreign-language acquisition, and medical treatment for patients with memory deficits.
2,078
A common mnemonic technique for remembering a list is to create an easily remembered acronym. Another is to create a memorable phrase with words which share the same first letter as the list members. Mnemonic techniques can be applied to most memorization of novel materials.
2,079
Some common examples for first-letter mnemonics:
2,080
Mnemonic phrases or poems can be used to encode numeric sequences by various methods, one common one is to create a new phrase in which the number of letters in each word represents the according digit of pi. For example, the first 15 digits of the mathematical constant pi can be encoded as "Now I need a drink, alcoho...
2,081
Another is used for "calculating" the multiples of 9 up to 9 × 10 using one's fingers. Begin by holding out both hands with all fingers stretched out. Now count left to right the number of fingers that indicates the multiple. For example, to figure 9 × 4, count four fingers from the left, ending at your left-hand index...
2,082
For remembering the rules in adding and multiplying two signed numbers, Balbuena and Buayan made the letter strategies LAUS and LPUN , respectively.
2,083
PUIMURI is a Finnish mnemonic regarding electricity: the first and last three letters can be arranged into the equations P = U × I {\displaystyle P=U\times I} and U = R × I ...
2,084
Mnemonics may be helpful in learning foreign languages, for example by transposing difficult foreign words with words in a language the learner knows already, also called "cognates" which are very common in Romance languages and other Germanic languages. A useful such technique is to find linkwords, words that have the...
2,085
For example, in trying to assist the learner to remember ohel , the Hebrew word for tent, the linguist Ghil'ad Zuckermann proposes the memorable sentence "Oh hell, there's a raccoon in my tent". The memorable sentence "There's a fork in Ma's leg" helps the learner remember that the Hebrew word for fork is mazleg . Simi...
2,086
Another Spanish example is by using the mnemonic "Vin Diesel Has Ten Weapons" to teach irregular command verbs in the you form. Spanish verb forms and tenses are regularly seen as the hardest part of learning the language. With a high number of verb tenses, and many verb forms that are not found in English, Spanish ve...
2,087
For French verbs which use être as an auxiliary verb for compound tenses: DR and MRS VANDERTRAMPP: descendre, rester, monter, revenir, sortir, venir, arriver, naître, devenir, entrer, rentrer, tomber, retourner, aller, mourir, partir, passer.
2,088
Masculine countries in French : "Neither can a breeze make a sane Japanese chilly in the USA." Netherlands , Canada, Brazil , Mexico , Senegal, Japan , Chile , & USA .
2,089
Mnemonics can be used in aiding patients with memory deficits that could be caused by head injuries, strokes, epilepsy, multiple sclerosis and other neurological conditions.
2,090
In a study conducted by Doornhein and De Haan, the patients were treated with six different memory strategies including the mnemonics technique. The results concluded that there were significant improvements on the immediate and delayed subtest of the RBMT, delayed recall on the Appointments test, and relatives rating ...
2,091
Academic study of the use of mnemonics has shown their effectiveness. In one such experiment, subjects of different ages who applied mnemonic techniques to learn novel vocabulary outperformed control groups that applied contextual learning and free-learning styles.
2,092
Mnemonics were seen to be more effective for groups of people who struggled with or had weak long-term memory, like the elderly. Five years after a mnemonic training study, a research team followed-up 112 community-dwelling older adults, 60 years of age and over. Delayed recall of a word list was assessed prior to, and...
2,093
This contrasts with a study from surveys of medical students that approximately only 20% frequently used mnemonic acronyms.
2,094
In humans, the process of aging particularly affects the medial temporal lobe and hippocampus, in which the episodic memory is synthesized. The episodic memory stores information about items, objects, or features with spatiotemporal contexts. Since mnemonics aid better in remembering spatial or physical information rat...
2,095
This could be further explained by one recent study which indicates a general deficit in the memory for spatial locations in aged adults compared to young adults . At first, the difference in target recognition was not significant.
2,096
The researchers then divided the aged adults into two groups, aged unimpaired and aged impaired, according to a neuropsychological testing. With the aged groups split, there was an apparent deficit in target recognition in aged impaired adults compared to both young adults and aged unimpaired adults. This further suppo...
2,097
Moreover, different research was done previously with the same notion, which presented with similar results to that of Reagh et al. in a verbal mnemonics discrimination task.
2,098
Studies have suggested that the short-term memory of adult humans can hold only a limited number of items; grouping items into larger chunks such as in a mnemonic might be part of what permits the retention of a larger total amount of information in short-term memory, which in turn can aid in the creation of long-term...
2,099
The dictionary definition of mnemonic at Wiktionary
2,100
The Harvard Mark I, or IBM Automatic Sequence Controlled Calculator , was one of the earliest general-purpose electromechanical computers used in the war effort during the last part of World War II.