100% found this document useful (1 vote)
571 views

Translator Program PDF

Translator programs such as interpreters, compilers, and assemblers convert high-level programming language code into machine-readable object code. Interpreters translate and execute each line of code sequentially, while compilers translate entire programs at once for faster execution. Assemblers convert assembly language mnemonics directly into machine code. All translator programs allow high-level languages suitable for humans to interface with low-level machine-executable object codes.

Uploaded by

CONSTANTINOS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
571 views

Translator Program PDF

Translator programs such as interpreters, compilers, and assemblers convert high-level programming language code into machine-readable object code. Interpreters translate and execute each line of code sequentially, while compilers translate entire programs at once for faster execution. Assemblers convert assembly language mnemonics directly into machine code. All translator programs allow high-level languages suitable for humans to interface with low-level machine-executable object codes.

Uploaded by

CONSTANTINOS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

SYLLABUS CODE: 22101/01 Author: Tanvir Iqbal Khan

O’ LEVEL COMPUTER SCIENCE Subject Specialist – O’ Level Computer Science


A’ Level Computing

1. TRANSLATOR PROGRAM
Translator programs are system software which converts the high-level language instructions into
machine code. It converts instructions written in one language to another without changing the initial
logic in terms of computer language.

The high-level languages are needed to convert into a low-level language because the computer can't
understand commands like "int i = 10". The processor only understands a very limited set of instructions,
and any high-level language code needs to be translated into a set of machine-readable instructions.

Translator programs are three types:-


1. Interpreter
2. Compiler
3. Assembler

1. INTERPRETER
It is a high-level language translator that converts individual high-level computer language program
instructions (source code) into machine instructions. It translates and executes each statement line-
by-line during the running of the program.

…………………
………..
……………
………
Interpreter 1010100010
……………………. 1101101001 Process Output
………… Software
……………….
…..

High-Level Language Converts into Low-Level Language/


Source File Machine Code each Machine Code
command at a time Object File

ADVANTAGES OF INTERPRETER
 Interpreter is easier to use for beginners.
 Errors are immediately displayed.
 Each error is corrected separately until program is able to be executed.
 It can be interpreted, change or start again while program is running.

DISADVANTAGES OF INTERPRETER
 Every time it has to be translated every time it is executed.
 The process of translation using interpreter is very slow.
 Interpreted programs can only run on computers that also have the interpreter.
1 Page

Website: sirtanviriqbalkhan.tk
Facebook: www.facebook.com/tanvirik
Email: [email protected]
PHONE: +923212490887
SYLLABUS CODE: 22101/01 Author: Tanvir Iqbal Khan
O’ LEVEL COMPUTER SCIENCE Subject Specialist – O’ Level Computer Science
A’ Level Computing

2. COMPILER
A software program that converts (translates) a complete software program written in high-level
language SOURCE CODE (such as PASCAL or FORTRAN) into machine language. The entire source
code is edited, compiled, and run at one time as compared to an INTERPRETER that is run one line at
a time.

…………………
………..
……………
………
Compiler 1010100010
……………………. 1101101001 Process Output
………… Software
……………….
…..

High-Level Language Converts into Low-Level Language/


Source File Machine Code whole Machine Code
program at once Object File
ADVANTAGES OF COMPILER
 It translates reading whole program all at once.
 The process of translation and execution is much faster.
 Compiler translated program can run on any computer.

DISADVANTAGES OF COMPILER
 Translated program cannot be change without going back to the original source code.
 Compiled program cannot be copied.

3. ASSEMBLER
A software program that converts (translates) each symbolic instruction written in ASSEMBLY
LANGUAGE into the MACHINE LANGUAGE (binary code) of a computer.

Assembler is a computer program which is used to translate program written in Assembly Language
in to machine language. The translated program is called as object program. Assembler checks each
instruction for its correctness and generates diagnostic messages, if there are mistakes in the
program. Various steps of assembling are:

 Input source program in Assembly Language through an input device.


 Use Assembler to produce object program in machine language.

…………………
………..
……………
………
Assembler 1010100010
……………………. 1101101001 Process Output
………… Software
……………….
…..

Mnemonic Converts into Low-Level Language/


Language/ Machine Code Machine Code
Assembly Language Object File
2 Page

Website: sirtanviriqbalkhan.tk
Facebook: www.facebook.com/tanvirik
Email: [email protected]
PHONE: +923212490887
SYLLABUS CODE: 22101/01 Author: Tanvir Iqbal Khan
O’ LEVEL COMPUTER SCIENCE Subject Specialist – O’ Level Computer Science
A’ Level Computing

ADVANTAGES OF ASSEMBLER
 As close to the machine as possible - each assembly instruction corresponds directly to a
machine instruction.
 Depending on the skill of the programmer, assembled programs can be extremely fast.
 Compiled assembly programs are usually rather small.

DISADVANTAGES OF ASSEMBLER
 Difficult to learn.
 Errors can be difficult to track down.
 Often cause the program (or machine) to crash unpredictably.
 Usually not portable to other computer systems.

o SOURCE CODE
Source code is what a programmer writes, but it is not directly executable by the computer. It must
be converted into machine language by compilers, assemblers or interpreters.

o OBJECT CODE
The code produced by a compiler or assembler from the source code, usually in
the form of machine language that a computer can execute directly, or sometimes
in assembly language. Object files contain compact code, often called "binaries"

…………………
………..
……………
………
Translator 1010100010
…………………….
………… Program 1101101001
……………….
…..

Source Code Converts into Object Code


(High-Level Language) Machine Code Low-Level Language/
Machine Code
Object File

3 Page

Website: sirtanviriqbalkhan.tk
Facebook: www.facebook.com/tanvirik
Email: [email protected]
PHONE: +923212490887

You might also like