Translation programs

A computer can only execute machine code programs, so, if a programmer writes a program in any other language, it has to be translated into machine code before the computer can run it.

An Assembler is a program which translates an Assembly language program into machine code.

(In the translation process the program being translated is referred to as the source program and the result is the object program)

There are two types of program which translate high-level language programs into machine code...

A Compiler - translates an entire high-level language program into a machine code program.

An Interpreter - translates each line of a high level language program into machine code and executes it as it goes.

Think of cooking a Chinese meal and having a Chinese recipe written in Chinese!

You could translate the whole recipe into English and then go and cook it later (Compiler)...

......or you could translate the first instruction into English, go and do it...come back, translate the second instruction into English, go and do it.... and do the same with the remaining instructions....and so on...(Interpreter)