+
Topic : Language Translator
Nazmul Hyder
ID : 011 131 085
+
Lecture Overview :
ASSEMBLER
COMPILER
INTERPRETER
+
Any program that is not written in machine
language has to be translated in machine
language before it is executed by the
computer. The means used for translation
are themselves computer programs. There
are three types of translator programs i.e.
Assembler, Compilers and Interpreters.
+
ASSEMBLER :
 To convert the assembly language into machine code .
 Translate mnemonic operation codes to their machine
language .
 Assigning machine addresses to symbolic labels.
+
Assembler Directives :
• The assembler can also process assembler
directives.
• Assembler directives (or pseudo-
instructions) provide instructions to the
assembler itself. They are not translated into
machine instructions
• E.g.
• START (specify name and starting address for
the program).
• END (indicate the end of the source program and
(optionally) specify the first executable instruction
in the program)
+
Working of Assembler :
• Programmer write a program using a sequence of
assemble instructions.
• This sequence of assembler instructions, known as
the source code/source program, then specified to
the assembler program when that program is
started.
• It translates a source code into machine language.
• The output of the assembler program is called the
object code or object program.
+
COMPILER :
• A compiler is a computer program that transforms
source code written in a programming
language(source language) into another
computer language(target language) .
• Compiler:
o Checks syntax of program
o Checks at a time all the program
• Primary reason for compiling source code is to
create an executable program
• Examples of compiler based language:
• C, C++, JAVA

+
Jobs of compiler :
1.To translate HLL source program to
machine codes.
2. To trace variables in the program
3. To include linkage for subroutines.
4. To allocate memory for storage of
program and variables.
5. To generate error messages, if there
are errors in the program
+
INTERPRETER :
• A computer program that executes
instructions written in a programming
language and do not produces the executable
file.
• Interpreter:
o Checks the keywords of a program
o Taking one instruction at a time and convert it into machine
language before taking upon the next instruction.
• Examples of interpreter based language:
o PHP, JavaScript, BASIC
+ Advantage :
1. Good at locating errors in programs
2. Debugging is easier since the interpreter stops
when it encounters an error.
3. If an error is deducted there is no need to
retranslate the whole program
Disadvantage :
1. Rather slow.
2. No object code is produced, so a translation has to
be done every time the program is running.
3. For the program to run, the Interpreter must
be present
+
THANK YOU  

Language Translator ( Compiler)

  • 1.
    + Topic : LanguageTranslator Nazmul Hyder ID : 011 131 085
  • 2.
  • 3.
    + Any program thatis not written in machine language has to be translated in machine language before it is executed by the computer. The means used for translation are themselves computer programs. There are three types of translator programs i.e. Assembler, Compilers and Interpreters.
  • 4.
    + ASSEMBLER :  Toconvert the assembly language into machine code .  Translate mnemonic operation codes to their machine language .  Assigning machine addresses to symbolic labels.
  • 5.
    + Assembler Directives : •The assembler can also process assembler directives. • Assembler directives (or pseudo- instructions) provide instructions to the assembler itself. They are not translated into machine instructions • E.g. • START (specify name and starting address for the program). • END (indicate the end of the source program and (optionally) specify the first executable instruction in the program)
  • 6.
    + Working of Assembler: • Programmer write a program using a sequence of assemble instructions. • This sequence of assembler instructions, known as the source code/source program, then specified to the assembler program when that program is started. • It translates a source code into machine language. • The output of the assembler program is called the object code or object program.
  • 7.
    + COMPILER : • Acompiler is a computer program that transforms source code written in a programming language(source language) into another computer language(target language) . • Compiler: o Checks syntax of program o Checks at a time all the program • Primary reason for compiling source code is to create an executable program • Examples of compiler based language: • C, C++, JAVA 
  • 8.
    + Jobs of compiler: 1.To translate HLL source program to machine codes. 2. To trace variables in the program 3. To include linkage for subroutines. 4. To allocate memory for storage of program and variables. 5. To generate error messages, if there are errors in the program
  • 9.
    + INTERPRETER : • Acomputer program that executes instructions written in a programming language and do not produces the executable file. • Interpreter: o Checks the keywords of a program o Taking one instruction at a time and convert it into machine language before taking upon the next instruction. • Examples of interpreter based language: o PHP, JavaScript, BASIC
  • 10.
    + Advantage : 1.Good at locating errors in programs 2. Debugging is easier since the interpreter stops when it encounters an error. 3. If an error is deducted there is no need to retranslate the whole program Disadvantage : 1. Rather slow. 2. No object code is produced, so a translation has to be done every time the program is running. 3. For the program to run, the Interpreter must be present
  • 11.