A computer program is a collection of instructions that describes a task, or set of tasks, to be carried out by a computer. More formally, it can be described as an expression of a computational method written in a computer language. Computer programs, also known as software, may be categorized along functional lines. These functional categories include application software, operating systems, video games, and compilers, among others. Computer programs embedded in hardware devices are called firmware. The formal expression of computational methods in a human-readable computer language is often referred to as source code, while the machine-executable expressions of computational methods are commonly referred to as executables, object code, or simply as binaries – a reference to the binary file format commonly used to store the executable code.
Program execution
A computer program exists in a source code form, viewable as a programming language; as a tokenised form, ready to be interpreted; or in machine code form, ready to be executed. Computer programs can be divided into two categories – system software and application software. System software is the operating system that couples the computer’s hardware with the application software. Application software couples the system software with the user interface.
A computer program is loaded into memory (usually by the operating system) and then executed (“run”), instruction by instruction, until termination, either with success or through software or hardware error. Before a computer can execute any sort of program (including the operating system, itself a program), the computer hardware must be initialized. This initialization is done in modern PCs by a piece of software stored on programmable memory chips installed by the manufacturer, called the BIOS. The BIOS will attempt to initialize the boot sequence, making the computer ready for higher-level program execution.
Programs vs data
The executable form of a program (that is, usually object code) is often treated as being different from the data the program operates on. In some cases this distinction is blurred with programs creating, or modifying, data, which is subsequently executed as part of the same program (this is a common occurrence for programs written in Lisp), see self-modifying code.