Page 11 - Computer - 6
P. 11
Assembly language programs are also machine-dependent. The programs written on one computer
may not run on another computer. An assembly language is also a low-level language because detailed
knowledge of hardware is still required.
In order to execute an assembly language program, you need to convert it into an equivalent machine
language program using an assembler.
Assembler
An Assembler is a language processor that converts an
assembly language program into a machine language
program. Each instruction in assembly language is usually
converted into one machine instruction.
Knowledge Discovery Subject Enrichment
The program written in any programming language other than machine language is called source code.
The program in machine language, executed directly by a computer, is called object code.
Third-Generation Programming Language (High-level Language)
A Third-generation programming language (3GL) is also known as
high-level language. It is a programmer-friendly and structured
language, similar to the English language. It uses English words and
mathematical symbols to develop a program.
High-leveI language programs are machine-independent. Programs
written for one computer can be executed on another computer with
minor changes or no changes at all. Some examples of third-generation Third-Generation Languages
programming languages are C, C++, Python, and Java.
In order to execute a high-level language program, you need to convert it into machine language, either
by using a compiler or an interpreter. Each high-level language requires its own compiler or interpreter.
Compiler
A Compiler is a language processor that converts a high-level language program into a machine language
program, in one go. It first scans the entire program and then translates it into the machine language. A
compiler also lists all errors in the program along with the line numbers on which the errors have occurred.
The translated program, or object code,
produced by a compiler is stored in the Source Code Compiler Machine Output
Code
computer and can be used to execute the
program in the future. How Compiler Works
Interpreter
An Interpreter is a language processor that converts a
high-level language program into a machine language Source Code Interpreter Output
program, line by line. It reads a line of source code,
converts it into machine code, and executes it. If there How Interpreter Works
is an error in the code, the interpreter waits for the error to be corrected before proceeding.
The object code produced by an interpreter is not stored on the computer. It is generated each time the
program is executed.
9