What is a Compiler?

At the heart of nearly all computers is the Central Processing Unit (CPU). This is the component which carries out the instructions found in programs. A program is a list of instructions, which the CPU executes one at a time.

Machine Language

The CPU understands only one language, commonly refered to as machine language. The CPU understands a fairly simple set of instructions, which are stored as numbers. Every operation the CPU knows how to perform has a different number associated with it, called an operation code or opcode. A machine language program is a list of numbers, which the CPU follows as a list of instructions.

Early computers were programmed only in this way. A programmer had to know what numbers coresponded to what operations, and their job was to encode a program that produced the desired result.

Assembly Language

It wasn't long, however, before programmers began to use a mnemonic representation of the operation codes. It was easier to remember short names than numbers. For example, the 6809 CPU recognized the number 137 to be the instruction to add a byte to the A register. The mnemonic represtation of this instruction is simple ADD. Programmers could write their programs using these mnemonic designations and then convert them to machine language later.

Programs were written to assemble a mnemonicly written program into machine language. These programs became known as assemblers, and the mnemonic representation became known as assembly language or assembler language. Assembly language is essentially the same as machine language, but is in a representation that a human easily understand. However, a program must be converted to machine language before the computer can execute it.

In other words, assembly language and machine language are the same language. One is convenient for the human programmer, who must design and create a program. The other is convenient for the CPU, which must decode and execute the instructions.

High Level Languages

As we have said, the instruction set of a CPU is somewhat limited. There is no concept of files or screen output or device I/O. Some CPU's do not even know how to multiply. Therefore, assembly programs which perform any complex task are fairly long, and the job of creating such a program is a tedious one.

For this reason, high level languages were created. These were designed to be more powerful than assembly language because similar tasks could be carried out with fewer instructions. A task that might be performed in several machine instructions