COMPUTER 2210 HANOUTS
GCE OLEVELS
Programming Languages
Programming Languages
“Programming language is a language designed to write computer programs. These languages are
used to give instructions to the computer.”
7.1 Types of Programming Languages
There are two types of programming languages
1. Low Level Languages
2. High Level Languages
7.1.1 Low Level Languages
Low level languages are those computer languages which provide little or no abstraction from
computer’s architecture.”
Low level languages are “close to the hardware” therefore these languages are not portable.
Low level languages are further divided into two types
i) Machine Language
ii) Assembly Language
7.1.1. A) MACHINE LANGAUGE
“Machine language is also known as binary language. It consists of binary digits 0 or 1.
Instruction written in machine language are called Operation Codes.”
Advantages
i) Computer can directly understand machine language.
ii) Machine language is fast in execution because it does not need any translation.
Disadvantages
i) Machine language is hard to learn and understand.
ii) It is difficult to find and correct errors from a program written in machine language.
iii) Programs written in machine language are not portable.
7.1.1. B) ASSEMBLY LANGUAGE
“In assembly language, all operation codes of the machine language are replaced by
letters and symbols called mnemonic codes.”
Advantages
i) Assembly language is easy to learn and understand as compared to machine language.
ii) It is easy to find and correct errors from assembly language as compared to machine language.
1
, Disadvantages
i) Although assembly language is easier as compared to machine language but it is still very difficult to
learn and understand.
ii) Program written in assembly language must be translated into machine language with help of
assembler.
iii) Programs written in assembly language are not portable.
Reasons for using Assembly Language
Few programmers write programs in an assembly language. Those programmers who do, do
so for the following reasons:
i. To make use of special hardware
ii. To make use of special machine-dependent instructions
iii. To write code that doesn’t take up much space in primary memory
iv. To write code that performs a task very quickly.
Mnemonic Codes
“Letters and symbols used in assembly language are called mnemonic codes.”
Instructions Mnemonic Code
Stop processing HLT
Add the number in memory to the number in accumulator. ADD
Multiply number in memory to the number in accumulator. MUL
Loads the contents of the memory address into the accumulator LDA
Stores the contents of the accumulator into the addressed location STO
7.1.2 HIGH LEVEL LANGUAGE / SYMBOLIC LANGUAGE
“High level languages use simple English like words which are easy to learn understand. These
languages are known as symbolic languages”
ADVANTAGES
i) High level languages are easy to learn and understand.
ii) Errors can be located easily.
iii) It is easy to debug a program written in high level language.
DISADVANTAGES
i) High level languages are not directly understandable by the computer.
ii) These languages need to be translated into machine language (with the help of translator)
before execution.
2
GCE OLEVELS
Programming Languages
Programming Languages
“Programming language is a language designed to write computer programs. These languages are
used to give instructions to the computer.”
7.1 Types of Programming Languages
There are two types of programming languages
1. Low Level Languages
2. High Level Languages
7.1.1 Low Level Languages
Low level languages are those computer languages which provide little or no abstraction from
computer’s architecture.”
Low level languages are “close to the hardware” therefore these languages are not portable.
Low level languages are further divided into two types
i) Machine Language
ii) Assembly Language
7.1.1. A) MACHINE LANGAUGE
“Machine language is also known as binary language. It consists of binary digits 0 or 1.
Instruction written in machine language are called Operation Codes.”
Advantages
i) Computer can directly understand machine language.
ii) Machine language is fast in execution because it does not need any translation.
Disadvantages
i) Machine language is hard to learn and understand.
ii) It is difficult to find and correct errors from a program written in machine language.
iii) Programs written in machine language are not portable.
7.1.1. B) ASSEMBLY LANGUAGE
“In assembly language, all operation codes of the machine language are replaced by
letters and symbols called mnemonic codes.”
Advantages
i) Assembly language is easy to learn and understand as compared to machine language.
ii) It is easy to find and correct errors from assembly language as compared to machine language.
1
, Disadvantages
i) Although assembly language is easier as compared to machine language but it is still very difficult to
learn and understand.
ii) Program written in assembly language must be translated into machine language with help of
assembler.
iii) Programs written in assembly language are not portable.
Reasons for using Assembly Language
Few programmers write programs in an assembly language. Those programmers who do, do
so for the following reasons:
i. To make use of special hardware
ii. To make use of special machine-dependent instructions
iii. To write code that doesn’t take up much space in primary memory
iv. To write code that performs a task very quickly.
Mnemonic Codes
“Letters and symbols used in assembly language are called mnemonic codes.”
Instructions Mnemonic Code
Stop processing HLT
Add the number in memory to the number in accumulator. ADD
Multiply number in memory to the number in accumulator. MUL
Loads the contents of the memory address into the accumulator LDA
Stores the contents of the accumulator into the addressed location STO
7.1.2 HIGH LEVEL LANGUAGE / SYMBOLIC LANGUAGE
“High level languages use simple English like words which are easy to learn understand. These
languages are known as symbolic languages”
ADVANTAGES
i) High level languages are easy to learn and understand.
ii) Errors can be located easily.
iii) It is easy to debug a program written in high level language.
DISADVANTAGES
i) High level languages are not directly understandable by the computer.
ii) These languages need to be translated into machine language (with the help of translator)
before execution.
2