Levels of Programming Languages
Levels of Programming Languages
MATHEMATICS DEPARTMENT
COMPUTER STUDIES AND ICT SECTION
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.
Low level languages are almost (but not quite) machine code.
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.
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’.