Machine Languages, Assembly Languages and High-Level Languages
Programmers write instructions in various programming languages, some directly under-standable by computers and others requiring intermediate translation steps. Hundreds of computer languages are in use today. These may be divided into three general types:
1. Machine languages
2. Assembly languages
3. High-level languages
Any computer can directly understand only its own machine language. Machine lan-guage is the “natural language” of a computer and as such is defined by its hardware design. [Note: Machine language is often referred to as object code. This term predates “object-oriented programming.” These two uses of “object” are unrelated.] Machine languages generally consist of strings of numbers (ultimately reduced to 1s and 0s) that instruct com-puters to perform their most elementary operations one at a time. Machine languages are machine dependent (i.e., a particular machine language can be used on only one type of computer). Such languages are cumbersome for humans, as illustrated by the following section of an early machine-language program that adds overtime pay to base pay and stores the result in gross pay:
Machine-language programming was simply too slow, tedious and error prone for most programmers. Instead of using the strings of numbers that computers could directly understand, programmers began using English-like abbreviations to represent elementary operations. These abbreviations formed the basis of assembly languages. Translator pro-grams called assemblers were developed to convert early assembly-language programs to machine language at computer speeds. The following section of an assembly-language pro-gram also adds overtime pay to base pay and stores the result in gross pay:
Although such code is clearer to humans, it is incomprehensible to computers until trans-lated to machine language.
Computer usage increased rapidly with the advent of assembly languages, but pro-grammers still had to use many instructions to accomplish even the simplest tasks. To speed the programming process, high-level languages were developed in which single statements could be written to accomplish substantial tasks. Translator programs called compilers convert high-level language programs into machine language. High-level lan-guages allow programmers to write instructions that look almost like everyday English and contain commonly used mathematical notations. A payroll program written in a high-level language might contain a statement such as
grossPay = basePay + overTimePay;
From your standpoint, obviously, high-level languages are preferable to machine and assembly language. C, C++, Microsoft’s .NET languages (e.g., Visual Basic, Visual C++ and Visual C#) and Java are among the most widely used high-level programming lan-guages. All of the Internet and web application development languages that you’ll learn in this book are high-level languages.
Copyright © 2018-2020 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.