Foundation of Programming Languages Part 1

Computer is an electronic device which works on the instructions provided by the user. As the computer does not understand natural language, it is required to provide the instructions in some computer understandable language. Such a computer understandable language is known as Programming language. A computer programming language consists of a set of symbols and characters, words, and grammar rules that permit people to construct instructions in the format that can be interpreted by the computer system.

Computer Programming is the art of making a computer do what you want it to do. Computer programming is a field that has to do with the analytical creation of source code that can be used to configure computer systems.

Computer programmers may choose to function in a broad range of programming functions, or specialize in some aspect of development, support, or maintenance of computers for the home or workplace. Programmers provide the basis for the creation and ongoing function of the systems that many people rely upon for all sorts of information exchange, both business related and for entertainment purposes.

1.1 Programming Language

Different programming languages support different styles of programming. The choice of language used is subject to many considerations, such as company policy, suitability to task, availability of third-party packages, or individual preference.

Ideally, the programming language best suited for the task at hand will be selected. Trade-offs from this ideal involve finding enough programmers who know the language to build a team, the availability of compilers for that language, and the efficiency with which programs written in a given language execute.

The basic instructions of programming language are:

  1. Input: Get data from the keyboard, a file, or some other device.
  2. Output: Display data on the screen or send data to a file or other device.
  3. Math: Perform basic mathematical operations like addition and multiplication.
  4. Conditional execution: Check for certain conditions and execute the appropriate sequence of statements.
  5. Repetition: Perform some action repeatedly, usually with some variation.

1.2 Assembly Language

Assembly languages are also known as second generation languages. These languages substitute alphabetic symbols for the binary codes of machine language. In assembly language, symbols are used in place of absolute addresses to represent memory locations. Mnemonics are used for operation code, i.e., single letters or short abbreviations that help the programmers to understand what the code represents. e.g.: MOV AX, DX.

Here mnemonic MOV represents ‘transfer’ operation and AX, DX are used to represent the registers.One of the fi rst steps in improving the program preparation process was to substitute letter symbols mnemonics for the numeric operation codes of machine language. A mnemonic is any kind of mental trick we use to help us remember. Mnemonics come in various shapes and sizes, all of them useful in their own way.

Use of Symbols Instead of Numeric of OpCodes

All computers have the power of handling letters as well as numbers. Hence, a computer can be taught to recognize certain combination of letter or numbers. It can be taught to substitute the number 14 every time it sees the symbol ADD, substitute the number 15 every time it sees the symbol SUB, and so forth.

In this way, the computer can be trained to translate a program written with symbols instead of numbers into the computer’s own machine language. Then we can write program for the computer using symbols instead of numbers, and have the computer do its own translating. This makes it easier for the programmer, because he can use letters, symbols, and mnemonics instead of numbers for writing his programs.





HLT Which would mean “take A, add B, store the result in C, type C, and halt.” The computer by means of a translating program, would translate each line of this program into the corresponding machine language program.

Advantages of Assembly Language

The main advantages of assembly language are:

  1. Assembly language is easier to use than machine language.
  2. An assembler is useful for detecting programming errors.
  3. Programmers do not have to know the absolute addresses of data items.
  4. Assembly languages encourage modular programming.


Disadvantages of Assembly Language

The main disadvantages of assembly language are:

  1. Assembly language programs are not directly executable.
  2. Assembly languages are machine dependent and, therefore, not portable from one machine to another.
  3. Programming in assembly language requires a higher level of programming skill.

1.3 Assembly Program Execution

An assembly program is written according to a strict set of rules. An editor or word processor is used for keying an assembly program into the computer as a file, and then the assembler is used to translate the program into machine code.