Number
int64
1
7.61k
Text
stringlengths
2
3.11k
2,601
Procedural programming could be considered a step toward declarative programming. A programmer can often tell, simply by looking at the names, arguments, and return types of procedures , what a particular procedure is supposed to do, without necessarily looking at the details of how it achieves its result. At the same ...
2,602
The programming paradigm used to build programs for almost all computers typically follows an imperative model. Digital computer hardware is designed to execute machine code, which is native to the computer and is usually written in the imperative style, although low-level compilers and interpreters using other paradig...
2,603
From this low-level perspective, the program state is defined by the contents of memory, and the statements are instructions in the native machine language of the computer. Higher-level imperative languages use variables and more complex statements, but still follow the same paradigm. Recipes and process checklists, wh...
2,604
Assignment statements, in imperative paradigm, perform an operation on information located in memory and store the results in memory for later use. High-level imperative languages, in addition, permit the evaluation of complex expressions, which may consist of a combination of arithmetic operations and function evaluat...
2,605
Early in the development of high-level programming languages, the introduction of the block enabled the construction of programs in which a group of statements and declarations could be treated as if they were one statement. This, alongside the introduction of subroutines, enabled complex structures to be expressed by ...
2,606
Many imperative programming languages are abstractions of assembly language.
2,607
The earliest imperative languages were the machine languages of the original computers. In these languages, instructions were very simple, which made hardware implementation easier but hindered the creation of complex programs. FORTRAN, developed by John Backus at International Business Machines starting in 1954, was ...
2,608
The 1980s saw a rapid growth in interest in object-oriented programming. These languages were imperative in style, but added features to support objects. The last two decades of the 20th century saw the development of many such languages. Smalltalk-80, originally conceived by Alan Kay in 1969, was released in 1980, by ...
2,609
FORTRAN was unveiled as "The IBM Mathematical FORmula TRANslating system." It was designed for scientific calculations, without string handling facilities. Along with declarations, expressions, and statements, it supported:
2,610
It succeeded because:
2,611
However, non IBM vendors also wrote Fortran compilers, but with a syntax that would likely fail IBM's compiler. The American National Standards Institute developed the first Fortran standard in 1966. In 1978, Fortran 77 became the standard until 1991. Fortran 90 supports:
2,612
COBOL stands for "COmmon Business Oriented Language." Fortran manipulated symbols. It was soon realized that symbols did not need to be numbers, so strings were introduced. The US Department of Defense influenced COBOL's development, with Grace Hopper being a major contributor. The statements were English-like and ver...
2,613
COBOL's development was tightly controlled, so dialects did not emerge to require ANSI standards. As a consequence, it was not changed for 15 years until 1974. The 1990s version did make consequential changes, like object-oriented programming.
2,614
ALGOL stands for "ALGOrithmic Language." It had a profound influence on programming language design. Emerging from a committee of European and American programming language experts, it used standard mathematical notation and had a readable structured design. Algol was first to define its syntax using the Backus–Naur f...
2,615
Algol's direct descendants include Pascal, Modula-2, Ada, Delphi and Oberon on one branch. On another branch there's C, C++ and Java.
2,616
BASIC stands for "Beginner's All Purpose Symbolic Instruction Code." It was developed at Dartmouth College for all of their students to learn. If a student did not go on to a more powerful language, the student would still remember Basic. A Basic interpreter was installed in the microcomputers manufactured in the late...
2,617
Basic pioneered the interactive session. It offered operating system commands within its environment:
2,618
However, the Basic syntax was too simple for large programs. Recent dialects added structure and object-oriented extensions. Microsoft's Visual Basic is still widely used and produces a graphical user interface.
2,619
C programming language got its name because the language BCPL was replaced with B, and AT&T Bell Labs called the next version "C." Its purpose was to write the UNIX operating system. C is a relatively small language -- making it easy to write compilers. Its growth mirrored the hardware growth in the 1980s. Its growth ...
2,620
C allows the programmer to control in which region of memory data is to be stored. Global variables and static variables require the fewest clock cycles to store. The stack is automatically used for the standard variable declarations. Heap memory is returned to a pointer variable from the malloc function.
2,621
In the 1970s, software engineers needed language support to break large projects down into modules. One obvious feature was to decompose large projects physically into separate files. A less obvious feature was to decompose large projects logically into abstract datatypes. At the time, languages supported concrete dat...
2,622
In object-oriented jargon, abstract datatypes are called classes. However, a class is only a definition; no memory is allocated. When memory is allocated to a class, it's called an object.
2,623
Object-oriented imperative languages developed by combining the need for classes and the need for safe functional programming. A function, in an object-oriented language, is assigned to a class. An assigned function is then referred to as a method, member function, or operation. Object-oriented programming is executing...
2,624
Object-oriented languages support a syntax to model subset/superset relationships. In set theory, an element of a subset inherits all the attributes contained in the superset. For example, a student is a person. Therefore, the set of students is a subset of the set of persons. As a result, students inherit all the attr...
2,625
C++ was originally called "C with Classes." It was designed to expand C's capabilities by adding the object-oriented facilities of the language Simula.
2,626
An object-oriented module is composed of two files. The definitions file is called the header file. Here is a C++ header file for the GRADE class in a simple school application:
2,627
A constructor operation is a function with the same name as the class name. It is executed when the calling operation executes the new statement.
2,628
A module's other file is the source file. Here is a C++ source file for the GRADE class in a simple school application:
2,629
Here is a C++ header file for the PERSON class in a simple school application:
2,630
Here is a C++ source file for the PERSON class in a simple school application:
2,631
Here is a C++ header file for the STUDENT class in a simple school application:
2,632
Here is a C++ source file for the STUDENT class in a simple school application:
2,633
Here is a driver program for demonstration:
2,634
Here is a makefile to compile everything:
2,635
In general, an ISA defines the supported instructions, data types, registers, the hardware support for managing main memory, fundamental features , and the input/output model of a family of implementations of the ISA.
2,636
An ISA specifies the behavior of machine code running on implementations of that ISA in a fashion that does not depend on the characteristics of that implementation, providing binary compatibility between implementations. This enables multiple implementations of an ISA that differ in characteristics such as performance...
2,637
If an operating system maintains a standard and compatible application binary interface for a particular ISA, machine code will run on future implementations of that ISA and operating system. However, if an ISA supports running multiple operating systems, it does not guarantee that machine code for one operating syst...
2,638
An ISA can be extended by adding instructions or other capabilities, or adding support for larger addresses and data values; an implementation of the extended ISA will still be able to execute machine code for versions of the ISA without those extensions. Machine code using those extensions will only run on implementa...
2,639
The binary compatibility that they provide makes ISAs one of the most fundamental abstractions in computing.
2,640
An instruction set architecture is distinguished from a microarchitecture, which is the set of processor design techniques used, in a particular processor, to implement the instruction set. Processors with different microarchitectures can share a common instruction set. For example, the Intel Pentium and the AMD Athlon...
2,641
The concept of an architecture, distinct from the design of a specific machine, was developed by Fred Brooks at IBM during the design phase of System/360.
2,642
Some virtual machines that support bytecode as their ISA such as Smalltalk, the Java virtual machine, and Microsoft's Common Language Runtime, implement this by translating the bytecode for commonly used code paths into native machine code. In addition, these virtual machines execute less frequently used code paths by ...
2,643
An ISA may be classified in a number of different ways. A common classification is by architectural complexity. A complex instruction set computer has many specialized instructions, some of which may only be rarely used in practical programs. A reduced instruction set computer simplifies the processor by efficiently ...
2,644
Other types include very long instruction word architectures, and the closely related long instruction word and explicitly parallel instruction computing architectures. These architectures seek to exploit instruction-level parallelism with less hardware than RISC and CISC by making the compiler responsible for instr...
2,645
Architectures with even less complexity have been studied, such as the minimal instruction set computer and one-instruction set computer . These are theoretically important types, but have not been commercialized.
2,646
Machine language is built up from discrete statements or instructions. On the processing architecture, a given instruction may specify:
2,647
More complex operations are built up by combining these simple instructions, which are executed sequentially, or as otherwise directed by control flow instructions.
2,648
Examples of operations common to many instruction sets include:
2,649
Processors may include "complex" instructions in their instruction set. A single "complex" instruction does something that may take many instructions on other computers. Such instructions are typified by instructions that take multiple steps, control multiple functional units, or otherwise appear on a larger scale than...
2,650
Complex instructions are more common in CISC instruction sets than in RISC instruction sets, but RISC instruction sets may include them as well. RISC instruction sets generally do not include ALU operations with memory operands, or instructions to move large blocks of memory, but most RISC instruction sets include SIMD...
2,651
On traditional architectures, an instruction includes an opcode that specifies the operation to perform, such as add contents of memory to register—and zero or more operand specifiers, which may specify registers, memory locations, or literal data. The operand specifiers may have addressing modes determining their mean...
2,652
Some exotic instruction sets do not have an opcode field, such as transport triggered architectures , only operand.
2,653
Most stack machines have "0-operand" instruction sets in which arithmetic and logical operations lack any operand specifier fields; only instructions that push operands onto the evaluation stack or that pop operands from the stack into variables have operand specifiers. The instruction set carries out most ALU actions ...
2,654
Conditional instructions often have a predicate field—a few bits that encode the specific condition to cause an operation to be performed rather than not performed. For example, a conditional branch instruction will transfer control if the condition is true, so that execution proceeds to a different part of the program...
2,655
Instruction sets may be categorized by the maximum number of operands explicitly specified in instructions.
2,656
addresses referring to memory cells, while reg1 and so on refer to machine registers.)
2,657
Due to the large number of bits needed to encode the three registers of a 3-operand instruction, RISC architectures that have 16-bit instructions are invariably 2-operand designs, such as the Atmel AVR, TI MSP430, and some versions of ARM Thumb. RISC architectures that have 32-bit instructions are usually 3-operand des...
2,658
Each instruction specifies some number of operands explicitly. Some instructions give one or both operands implicitly, such as by being stored on top of the stack or in an implicit register. If some of the operands are given implicitly, fewer operands need be specified in the instruction. When a "destination operand" ...
2,659
Register pressure measures the availability of free registers at any point in time during the program execution. Register pressure is high when a large number of the available registers are in use; thus, the higher the register pressure, the more often the register contents must be spilled into memory. Increasing the n...
2,660
While embedded instruction sets such as Thumb suffer from extremely high register pressure because they have small register sets, general-purpose RISC ISAs like MIPS and Alpha enjoy low register pressure. CISC ISAs like x86-64 offer low register pressure despite having smaller register sets. This is due to the many add...
2,661
The size or length of an instruction varies widely, from as little as four bits in some microcontrollers to many hundreds of bits in some VLIW systems. Processors used in personal computers, mainframes, and supercomputers have minimum instruction sizes between 8 and 64 bits. The longest possible instruction on x86 is 1...
2,662
Fixed-length instructions are less complicated to handle than variable-length instructions for several reasons , and are therefore somewhat easier to optimize for speed.
2,663
In early 1960s computers, main memory was expensive and very limited, even on mainframes. Minimizing the size of a program to make sure it would fit in the limited memory was often central. Thus the size of the instructions needed to perform a particular task, the code density, was an important characteristic of any in...
2,664
Computers with high code density often have complex instructions for procedure entry, parameterized returns, loops, etc. . However, more typical, or frequent, "CISC" instructions merely combine a basic ALU operation, such as "add", with the access of one or more operands in memory . Certain architectures may allow two ...
2,665
Reduced instruction-set computers, RISC, were first widely implemented during a period of rapidly growing memory subsystems. They sacrifice code density to simplify implementation circuitry, and try to increase performance via higher clock frequencies and more registers. A single RISC instruction typically performs onl...
2,666
Certain embedded RISC ISAs like Thumb and AVR32 typically exhibit very high density owing to a technique called code compression. This technique packs two 16-bit instructions into one 32-bit word, which is then unpacked at the decode stage and executed as two instructions.
2,667
Minimal instruction set computers are commonly a form of stack machine, where there are few separate instructions , so that multiple instructions can be fit into a single machine word. These types of cores often take little silicon to implement, so they can be easily realized in an FPGA or in a multi-core form. The co...
2,668
There has been research into executable compression as a mechanism for improving code density. The mathematics of Kolmogorov complexity describes the challenges and limits of this.
2,669
In practice, code density is also dependent on the compiler. Most optimizing compilers have options that control whether to optimize code generation for execution speed or for code density. For instance GCC has the option -Os to optimize for small machine code size, and -O3 to optimize for execution speed at the cost o...
2,670
The instructions constituting a program are rarely specified using their internal, numeric form ; they may be specified by programmers using an assembly language or, more commonly, may be generated from high-level programming languages by compilers.
2,671
The design of instruction sets is a complex issue. There were two stages in history for the microprocessor. The first was the CISC , which had many different instructions. In the 1970s, however, places like IBM did research and found that many instructions in the set could be eliminated. The result was the RISC , an ar...
2,672
Some instruction set designers reserve one or more opcodes for some kind of system call or software interrupt. For example, MOS Technology 6502 uses 00H, Zilog Z80 uses the eight codes C7,CF,D7,DF,E7,EF,F7,FFH while Motorola 68000 use codes in the range A000..AFFFH.
2,673
Fast virtual machines are much easier to implement if an instruction set meets the Popek and Goldberg virtualization requirements.
2,674
The NOP slide used in immunity-aware programming is much easier to implement if the "unprogrammed" state of the memory is interpreted as a NOP.
2,675
On systems with multiple processors, non-blocking synchronization algorithms are much easier to implement if the instruction set includes support for something such as "fetch-and-add", "load-link/store-conditional" , or "atomic compare-and-swap".
2,676
A given instruction set can be implemented in a variety of ways. All ways of implementing a particular instruction set provide the same programming model, and all implementations of that instruction set are able to run the same executables. The various ways of implementing an instruction set give different tradeoffs be...
2,677
When designing the microarchitecture of a processor, engineers use blocks of "hard-wired" electronic circuitry such as adders, multiplexers, counters, registers, ALUs, etc. Some kind of register transfer language is then often used to describe the decoding and sequencing of each instruction of an ISA using this physic...
2,678
Some computer designs "hardwire" the complete instruction set decoding and sequencing .
2,679
Other designs employ microcode routines or tables to do this, using ROMs or writable RAMs , PLAs, or both.
2,680
Some microcoded CPU designs with a writable control store use it to allow the instruction set to be changed .
2,681
CPUs designed for reconfigurable computing may use field-programmable gate arrays .
2,682
An ISA can also be emulated in software by an interpreter. Naturally, due to the interpretation overhead, this is slower than directly running programs on the emulated hardware, unless the hardware running the emulator is an order of magnitude faster. Today, it is common practice for vendors of new ISAs or microarchite...
2,683
Often the details of the implementation have a strong influence on the particular instructions selected for the instruction set. For example, many implementations of the instruction pipeline only allow a single memory load or memory store per instruction, leading to a load–store architecture . For another example, some...
2,684
The demands of high-speed digital signal processing have pushed in the opposite direction—forcing instructions to be implemented in a particular way. For example, to perform digital filters fast enough, the MAC instruction in a typical digital signal processor must use a kind of Harvard architecture that can fetch an ...
2,685
IBM PC compatible computers are similar to the original IBM PC, XT, and AT, all from computer giant IBM, that are able to use the same software and expansion cards. Such computers were referred to as PC clones, IBM clones or IBM PC clones. The term "IBM PC compatible" is now a historical description only, since IBM n...
2,686
These "clones" duplicated almost all the significant features of the original IBM PC architectures. This was facilitated by IBM's choice of commodity hardware components, which were cheap, and by various manufacturers' ability to reverse-engineer the BIOS firmware using a "clean room design" technique. Columbia Data Pr...
2,687
Early IBM PC compatibles used the same computer buses as their IBM counterparts, switching from the 8-bit IBM PC and XT bus to the 16-bit IBM AT bus with the release of the AT. IBM's introduction of the proprietary Micro Channel architecture in its PS/2 series resulted in the establishment of the Extended Industry Sta...
2,688
Descendants of the x86 IBM PC compatibles, namely 64-bit computers based on "x86-64/AMD64" chips comprise the majority of desktop computers on the market as of 2021, with the dominant operating system being Microsoft Windows. Interoperability with the bus structure and peripherals of the original PC architecture may be...
2,689
Only the Macintosh had kept significant market share without having compatibility with the IBM PC, although that changed during the Intel Macs era running Mac OS X, often dual-booting Windows with Boot Camp.
2,690
IBM decided in 1980 to market a low-cost single-user computer as quickly as possible. On August 12, 1981, the first IBM PC went on sale. There were three operating systems available for it. The least expensive and most popular was PC DOS made by Microsoft. In a crucial concession, IBM's agreement allowed Microsoft to ...
2,691
IBM at first asked developers to avoid writing software that addressed the computer's hardware directly and to instead make standard calls to BIOS functions that carried out hardware-dependent operations. This software would run on any machine using MS-DOS or PC DOS. Software that directly addressed the hardware instea...
2,692
Rumors of "lookalike," compatible computers, created without IBM's approval, began almost immediately after the IBM PC's release. InfoWorld wrote on the first anniversary of the IBM PC that
2,693
By June 1983 PC Magazine defined "PC 'clone'" as "a computer accommodate the user who takes a disk home from an IBM PC, walks across the room, and plugs it into the 'foreign' machine". Because of a shortage of IBM PCs that year, many customers purchased clones instead. Columbia Data Products produced the first compute...
2,694
At the same time, many manufacturers such as Tandy/RadioShack, Xerox, Hewlett-Packard, Digital Equipment Corporation, Sanyo, Texas Instruments, Tulip, Wang and Olivetti introduced personal computers that supported MS-DOS, but were not completely software- or hardware-compatible with the IBM PC.
2,695
Tandy described the Tandy 2000, for example, as having a "'next generation' true 16-bit CPU", and with "More speed. More disk storage. More expansion" than the IBM PC or "other MS-DOS computers". While admitting in 1984 that many PC DOS programs did not work on the computer, the company stated that "the most popular, s...
2,696
Like IBM, Microsoft's apparent intention was that application writers would write to the application programming interfaces in MS-DOS or the firmware BIOS, and that this would form what would now be termed a hardware abstraction layer. Each computer would have its own Original Equipment Manufacturer version of MS-DOS,...
2,697
This expectation seemed reasonable in the computer marketplace of the time. Until then Microsoft's business was based primarily on computer languages such as BASIC. The established small system operating software was CP/M from Digital Research which was in use both at the hobbyist level and by the more professional of ...
2,698
Microsoft's competing OS was intended initially to operate on a similar varied spectrum of hardware, although all based on the 8086 processor. Thus, MS-DOS was for several years sold only as an OEM product. There was no Microsoft-branded MS-DOS: MS-DOS could not be purchased directly from Microsoft, and each OEM releas...
2,699
MS-DOS provided adequate functionality for character-oriented applications such as those that could have been implemented on a text-only terminal. Had the bulk of commercially important software been of this nature, low-level hardware compatibility might not have mattered. However, in order to provide maximum performan...
2,700
In May 1983, Future Computing defined four levels of compatibility: