0% found this document useful (0 votes)
49 views4 pages

Levels of Programming Languages

Machine code is the lowest level language directly understood by computers. Higher level languages like assembly are closer to machine code but use mnemonics. High level languages use keywords and syntax rules and require compilers or interpreters to translate them to machine code. High level languages are easier for humans but require translation, making them less efficient than low level languages. Machine code provides the most control and efficiency while high level languages enhance productivity and portability.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
49 views4 pages

Levels of Programming Languages

Machine code is the lowest level language directly understood by computers. Higher level languages like assembly are closer to machine code but use mnemonics. High level languages use keywords and syntax rules and require compilers or interpreters to translate them to machine code. High level languages are easier for humans but require translation, making them less efficient than low level languages. Machine code provides the most control and efficiency while high level languages enhance productivity and portability.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

MUFULIRA COLLEGE OF EDUCATION

MATHEMATICS DEPARTMENT
COMPUTER STUDIES AND ICT SECTION

MACHINE CODE, LOW LEVEL AND HIGH


LEVEL PROGRAMMING LANGUAGES
1. INTRODUCTION
Computer programming languages can be classified as Machine Code, Low Level
or High Level depending on how close they are to the language that computers or
human beings understand.

2. MACHINE CODE
Machine code refers to the language that a computer’s CPU understands. A CPU
follows binary instructions; following is a typical binary instruction:

These instructions are stored in memory locations called 'Registers' within the
CPU. Different CPUs have a different set of registers.
Hence, the raw instructions that the CPU carries out is called 'machine code' and
each CPU family has a different set of machine code.
A person would find such a list of binary instructions virtually impossible to
follow. Perhaps a slightly friendlier way would be to use hexadecimal, where

But it is still too hard and a better way of programming had to be developed.

Note that; another name for Machine code is 'object code'.


ADVANTAGES OF MACHINE CODE PROGRAMMING LANGUAGES
 Machine code language makes fast and efficient use of the computer.
 It requires no translator to translate the code. It is directly understood by the
computer.

DISADVANTAGES OF LOW LEVEL PROGRAMMING LANGUAGES


 All operation codes have to be remembered
 All memory addresses have to be remembered.

3. LOW LEVEL PROGRAMMING LANGUAGES


A low level language is one whose programming statements are geared towards
a particular CPU family, such as the Intel x86 family of processors.

Low level languages are almost (but not quite) machine code.

Assembly language' is an example of a low level programming language.

Some features of Low Level languages include


 They are CPU specific, making direct use of internal registers
 'Mnemonics' are used as programming code such as MOV or ADD
 Many different memory modes can be used
 Labels are used as reference points to allow the code to jump from one part
to another.

So CPU engineers provide their customers with an 'assembly language' which they
can use to program the CPU.
An assembly language is made up of a reasonably small set of command words
called 'Mnemonics
The table below shows the machine code and the equivalent mnemonic in
assembly language.

Along with the assembly language comes a software application called an


'Assembler'. This converts the assembly instructions back into machine code.

ADVANTAGES OF LOW LEVEL PROGRAMMING LANGUAGES


 Low level languages have the advantage of providing very close control of
the CPU, for example many device drivers are coded in assembly language.
 They can be very efficient - well optimised code written in a low level
language can be made to run very quickly compared to code written in a high
level language.

DISADVANTAGES OF LOW LEVEL PROGRAMMING LANGUAGES


 The code is still quite difficult to read and follow by other programmers.
 They are difficult to use as the programming commands can be quite
obscure.
 A good assembly language programmer needs to know a lot of detail about
the internal structure of the CPU - e.g. its registers and memory management
methods.
 Low level languages produce the least portable source code - Each CPU
family has its own assembly language and so code written for one CPU
family does not run on other CPUs. This means the code is not very
'portable'.
4. HIGH LEVEL PROGRAMMING LANGUAGES
High level languages were developed in order to make programming a lot easier
compared to coding in assembly or machine language.

A high level language has two main features


 It has a set of keywords such as PRINT or IF
 It has a set of grammar rules (syntax) which define how to combine them
correctly

A programmer writes source code using the allowed set of keywords and its syntax
rules.

There are many high level languages. For example Java, Python, C++, C, Pascal,
FORTRAN, BASIC, Java, Lisp, Smalltalk and so on.

However, source code is really just a text file. And so it needs to be converted into
machine (object) code to run in a CPU. This is the task of a piece of software called
a 'translator', which is either a ‘Compiler’ or an ‘Interpreter’.

ADVANTAGES OF MACHINE CODE PROGRAMMING LANGUAGES


 High level languages are programmer friendly. They are easy to write, debug
and maintain.
 They provide higher level of abstraction from machine languages.
 They are machine independent languages.
 They are easy to learn.
 They are less error prone, easy to find and debug errors.
 High level programming results in better programming productivity.

DISADVANTAGES OF LOW LEVEL PROGRAMMING LANGUAGES


 It takes additional translation times to translate the source to machine code.
 High level programs are comparatively slower than low level programs.
 Compared to low level programs, they are generally less memory efficient.
 Cannot communicate directly with the hardware.

You might also like