Language is a system for representation and communication of information or data. Like human beings, a language or signal is required to communicate between two persons. Similarly, we cannot obtain any result by computer without langtage. Computer does not understand directly what we are communicating with computer as English or Arabic, it understands only machine language (binary codes 0-1). Computer translates English language into machine codes through interpreter then process instructions and give us the results.
The computer languages can be divided into two main levels.
• Machine language (0-1)
• Symbolic language (A-Z)
Symbolic languages are further divide into two main levels
• High-level language
• Low-level language
Although computers can be programmed to understand many different computer language. There is only one language understood by the computer without using a translation program. This language is called the machine language or the machine codes. Machine codes are the fundamental language of the computer and is normally written as strings of binary 0-1.
ADVANTAGES AND LIMITATIONS OF MACHINE LANGUAGE
Programs written in machine language can be executed very fast by the computer. This is mainly because machine instructions are directly understood by the CPU and no translation of program is required.
However, writing a program in machine language has several disadvantage.
Because the internal design of every type of computer is different from every other type of computer and needs different electrical signals to operate. The machine language also is different from computer to computer.
DIFFICULT TO PROGRAM
Although easily used by the computer, machine language is difficult to program. It is necessary for the programmer either to memorize the dozens of code number for the commands in the machine’s instruction set or to constantly refer to a reference card.
DIFFICULT TO MODIFY
It is difficult to correct or modify machine language programs. Checking machine instructions to locate errors is difficult as writing them initially.
In short, writing a program in machine language is so difficult and time consuming.
In symbolic languages, alphabets are used (a-z). symbolic languages are further divide into two main levels.
• High level languages
• Low level languages
LOW LEVEL LANGUAGE
A language which is one step higher than machine language in human readability is called Assembly Language or a low-level language. In an assembly language binary numbers are replaced by human readable symbols called mnemonics. Thus a low-level language is better in understanding than a machine language for humans and almost has the same efficiency as machine language for computer operation. An assembly language is a combination of mnemonic, operation codes and symbolic codes for addresses. Each computer uses and has a mnemonic code for each instruction, which may vary from computer to computer. Some of the commonly used codes are given in the following table.
Add – ADD
Subtract – SUB
Multiply – MUL
Compare Registry – CR
Compare – COMP
Branch Condition -BC
Code Register -LR
Move Characters -MVE
Store Characters -STC
Store Accumulator – STA
An assembly language is very efficient but it is difficult to work with and it requires good skills for programming. A program written in an assembly language is translated into a machine language before execution. A computer program which translates any assembly language into its equivalent machine code is known as an assembler.
HIGH – LEVEL LANGUAGE
A language is one step higher than low-level languages in human readability is called high-level language. High – level languages are easy to understand. They are also called English oriented languages in which instruction are given using words. Such as add, subtract, input, print, etc. high level language are very easy for programming, programmer prefer them for software designing that’s why these languages are also called user’s friendly languages. Every high level language must be converted into machine language before execution, therefore every high level language has its own separate translating program called compiler or interpreter. That’s why some time these languages are called compiler langauges. COBOL, BASIC, PASCAL, RPG, FORTRAN are some high level languages.
An interpreter is a set of programs which translates the high-level language into machine acceptable form. The interpreters are slow in speed as compared to compilers. The interpreter takes a single line of the source code, translates that line into object code and carries it out immediately. The process is repeated line by line until the whole program has been translated and run. If the program loops back to earlier statements, they will be translated afresh each time round. This means that both the source program and the interpreter must remain in the main memory together which may limit the space available for data. Perhaps the biggest drawback of an interpreter is the time it takes to translate and run a program including all the repetition which can be involved.