Language Translator Paper 1 Prepared by Mazhar Javed
Language Translator Paper 1 Prepared by : Mazhar Javed Awan 1
Types of codes • Source code • Is written in high language or assembly language • Easy to understand • Easy to modify • Contain fewer statements • It contain. exe extension • Object code • Is written in machine language through compiler • difficult to understand • Difficult to modify • More statement than source code • It contain. obj extension Prepared by : Mazhar Javed Awan 2
Compiler • Is software that converts the whole of a program written in a high level language into machine code in one go. • There are no mistakes in the program the complete program is converted to machine code • If a program needs to be altered at a later date the original source code is altered and program recompiled Prepared by : Mazhar Javed Awan 3
Interpreter • Each instructions in turn, converts it to machine code and then caries it out • It run one line at a time • The computer recognizes each instruction Prepared by : Mazhar Javed Awan 4
Differences • Compiler • Converts a program into a machine code as a whole code • Creates object code file • Converts high level programs that can be executed in many times • Execution is fast • Displays syntax errors after compiling the whole program • Interpreter • Converts a program into machine code statement by statement • Object file is not created • Converts high level programs each time it is executed • Program execution is slow • Displays the syntax error on each statement of program Prepared by : Mazhar Javed Awan 5
Assembler • Is a program which translates a program written in as assembly language into are in machine code • The main functions of an assembler are to : • Translate an assembly language source program into a machine code object program • Work out where to store the object program and its data • Detects errors in the source program and say what they are • Link the program to any other programs or routines it uses Prepared by : Mazhar Javed Awan 6
Relationship Assembly Language Code High Level Language Code Assembler Compiler Machine Prepared by. Code : Mazhar Javed Awan High Level Language Code Interpreter 7
- Slides: 7