Grade 9 Notes Printed - 18 - 2010 - Programming Languages
Grade 9 Notes Printed - 18 - 2010 - Programming Languages
Program: A program is a set of instructions that the computer can understand. A program is
written in a computer language and it must be translated to binary code for it to work (run).
Translation Program:
Translation programs are part of the system’s software and are used to convert HLL programs
into machine code.
Types of Translation Programs:
Interpreter
Compiler
Assembler
Interpreter:
Interpreter reads each line of HLL program translates it to machine code and runs it.
Shows errors (if any) once a line is translated. The error must be corrected to proceed
further.
Execution of program is slow compared to compiled program.
Each time the program is run, it is interpreted. Interpreter is needed all the time.
Assembler:
An assembler translates an assembly language program into machine code. This is
quiet easy as each instruction in assembly language corresponds to a specific binary
code in machine language.
Any errors in the program are shown after translation and those have to be corrected
and the program retranslated.
Creates translated program code called as object file.
Executes program very fast.
Source code: The program written in a HLL is called source code.
Object code: The translated program that contains machine code is called object code.
Whenever the program needs to be run the object code can be used. The advantage is the
source code can be modified any number of times and each time produce an object code.
The object code cannot be edited or modified.
Translate using a translator
Steps to add two Program to add Program to add two Steps to add two
numbers two numbers numbers numbers