INTRODUCTION TO LANGUAGES
Introduction to Languages:
The basic components of a computer are:
- Input unit
- Central Processing Unit(CPU)
- Output unit
The CPU is further divided into three parts-
Memory unit
Control unit
Arithmetic Logic unit
Most of us have heard that the CPU is called the brain of our computer because it accepts data, provides temporary memory space to it until it is stored(saved) on the hard disk, performs logical operations on it, and hence processes(here also means converts) data into information.
We all know that a computer consists of hardware and software. Software is a set of programs that performs multiple tasks together. An operating system is also software (system software) that helps humans to interact with the computer system.
A program is a set of instructions given to a computer to perform a specific operation. or computer is a computational device that is used to process data under the control of a computer program. While executing the program, raw data is processed into the desired output format. These computer programs are written in a programming language which is a high-level language.
High-level languages are nearly human languages that are more complex than the computer understandable language which is called machine language, or low-level language. So after knowing the basics, we are ready to create a very simple and basic program. Like we have different languages to communicate with each other, likewise, we have different languages like C, C++, C#, Java, python, etc to communicate with computers. The computer only understands binary language (the language of 0’s and 1’s) also called machine-understandable language or low-level language but the programs we are going to write are in a high-level language which is almost similar to human language.
There are major three types of Languages
- Machine Level Language
- Assembly-level languages
- High-level languages
Machine level Language :
Machine language is the elemental language of computers. It is read by the computer's central processing unit (CPU), is composed of digital binary numbers, and looks like a very long sequence of zeros and ones. Ultimately, the source code of every human-readable programming language must be translated to machine language by a compiler or an interpreter, because binary code is the only language that computer hardware can understand. Each CPU has its own specific machine language. The processor reads and handles instructions, which tell the CPU to perform a simple task. Instructions are comprised of a certain number of bits. If instructions for a particular processor are 8 bits, for example, the first 4 bits part (the opcode) tells the computer what to do and the second 4 bits (the operand) tells the computer what data to use. 01001000 01100101 01101100 01101100 01101111 00100001 Depending upon the processor, a computer's instruction sets may all be the same length, or they may vary, depending upon the specific instruction. The architecture of the particular processor determines how instructions are patterned. The execution of instructions is controlled by firmware or the CPU's internal wiring. Human programmers rarely, if ever, deal directly with machine code anymore. If developers debug a program at a low level, they might use a printout showing the program in its machine code form. The printout, which is called a dump, is very difficult to work with a tool called a dump. Utility programs used to create dumps will often represent four bits by a single hexadecimal to make the machine code easier to read and contain other information about the computer's operation, such as the address of the instruction that was being executed at the time the dump was initiated.
Assembly level language :
BAL (Basic Assembler Language) is a version of IBM's assembler language (sometimes called assembly language). It is a low-level language that allows users to write a program using alphanumeric mnemonic codes, instead of numeric code for a set of instructions Assembly language is a low-level programming language for a computer or other programmable device specific to a particular computer architecture in contrast to most high-level programming languages, which are generally portable across multiple systems. Assembly language is converted into executable machine code by a utility program referred to as an assembler like NASM, MASM, etc. Each personal computer has a microprocessor that manages the computer's arithmetical, logical, and control activities. Each family of processors has its own set of instructions for handling various operations such as getting input from the keyboard, displaying information on the screen, and performing various other jobs. These sets of instructions are called 'machine language instructions'. A processor understands only machine language instructions, which are strings of 1's and 0's. However, machine language is too obscure and complex for use in software development. So, the low-level assembly language is designed for a specific family of processors that represents various instructions in symbolic code and a more understandable form.
Advantages of Assembly Language
Having an understanding of assembly language makes one aware of the −
- How programs interface with OS, processor, and BIOS;
- How data is represented in memory and other external devices;
- How the processor accesses and executes instructions;
- How instructions to access and process data;
- How a program accesses external devices.
Other advantages of using assembly language are −
- It requires less memory and execution time;
- It allows hardware-specific complex jobs more easily;
- It is suitable for time-critical jobs;
- It is most suitable for writing interrupt service routines and other memory resident programs
Comments
Post a Comment