Unit 1 Programming Languages flutterjunction.com
Chapter outline • Introduction • Analogy with Natural Language • Classification of Computer Languages • Program Language Translator • Linker and loader • Generation of Computer Languages • Machines Independent and Portability of Programs • Some Important Types of High-Level Language flutterjunction.com
Introduction • Program: A program is a set of instructions that a computer follows to perform a specific task. Programs are written in a programming language, which is a standardized set of rules and conventions for specifying the instructions that a computer should execute. Programs can be as simple as a series of instructions that tell a computer to perform a single task, or they can be much more complex, comprising hundreds or thousands of instructions that work together to perform a variety of tasks. • Software: Software is a general term for the various kinds of programs that run on a computer. It can include applications that perform specific tasks, such as word processing or graphics editing, as well as the operating system, which is the software that manages the computer's hardware and coordinates the various programs that run on the computer. flutterjunction.com
Program Vs Software flutterjunction.com
Program Vs Software flutterjunction.com
Program Vs Software flutterjunction.com
Characteristics of Good Software or Program • Integrity: Software integrity refers to the quality of the software’s source code. And, code quality is essential as it is a measure of how safe, secure, and reliable it is. • Clarity: The ability of the software to be easy to understand and use. • Simplicity: Software should be easy to understand and use. This means that the software should be straightforward and intuitive, and should not include unnecessary features or complexity. • Efficiency: the ability of the software to use resources effectively and to perform tasks quickly. Efficiency is important in software because it can improve the performance of the software and make it more effective. flutterjunction.com
Characteristics of Good Software or Program • Generality: The programs inside software should be general. • Modularity: Separate self contained modules should be in software to understand what is happening in software. • Robustness: Program must be fault tolerant. Robust software is able to handle a wide range of inputs and conditions without crashing or producing incorrect results. • Security: Program must be secure to avoid tampering from unwanted people. flutterjunction.com
Computer language or programming language The world is controlled through the flow of information. The information can be communicated through various mediums like signals, sounds, music, certain key stocks (coding) etc. therefore the language is the means of communication so that people can easily understand the meaning. So the language is major element for the communication system. Language can be classified into 2 groups: 1. Natural Language 2. Computer language flutterjunction.com
Types of Computer Language Generally there are different kinds of computer languages, but they are generally grouped into two levels: ● Low level language ● High level language 1. Low level language A low-level programming language is a language that provides little or no abstraction from a computer's instruction set architecture. Low-level languages are closer to machine code, the code that is actually executed by a computer's central processing unit (CPU). Low-level languages are generally more difficult to read and write than high-level languages, which are closer to human languages and are designed to be easier for humans to read and write. flutterjunction.com
Classification of Low level Language 1. Machine language Machine language or machine code, is a low-level programming language that consists of binary digits (ones and zeros). It is the only language that a computer is capable of understanding and executing directly. Machine code is not human- readable and must be written in a hexadecimal or binary editor. Machine code is usually specific to a particular type of computer or processor, so code written in machine code will only run on the type of machine for which it was written. Machine code is the lowest level of programming language and is the foundation upon which all other programming languages are built. flutterjunction.com
Classification of Low level Language 1. Machine language Advantages ● It is faster in execution ● Has high efficiency ● Translators are not necessary to convert the language ● It can directly control hardware components of computer so high security can be maintained. flutterjunction.com
Classification of Low level Language 1. Machine language Disadvantages ● Machine dependent so program written for one processor cannot be used in ● others. ● Difficult to program due to the use of o and 1 ● Error prone ● Difficult to modify ● Time consuming and expensive, almost impossible to develop large program flutterjunction.com
Classification of Low level Language 2. Assembly Level Language Assembly language is a low-level programming language that is used to write programs that are executed directly by a computer's central processing unit (CPU). Assembly language is specific to a particular type of computer or processor, so code written in assembly language will only run on the type of machine for which it was written. Assembly language is generally more difficult to read and write than high- level languages, such as C and Python, but it provides more control over the hardware and can be used to write more efficient code. flutterjunction.com
Classification of Low level Language 2. Assembly Level Language The use of alphanumeric symbols called mnemonics codes are used so it is also called symbolic programming language. ADD, SUB, JMP, RET, EXIT, PRINT, MOD, LEVEL, START etc. The program written in Assembly level language should be converted in machine level language and the conversion is performed by an assembler. flutterjunction.com
Classification of Low level Language 1. Assembly Language Advantages ● It is easier to write, debug and understand due to use of mnemonics. ● Execution is faster than high level languages ● It is efficient so is still in use for developing firmware, device driver, operating system kernel. flutterjunction.com
Classification of Low level Language 1. Assembly Language Disadvantages ● It is also machine dependent. ● Program development and debugging is difficult and time consuming as compared to high level languages ● It is hard to remember the mnemonics flutterjunction.com
High level language To overcome the limitations of the low level programming languages lead to the development of high level programming language. High level programming languages are English like language and their syntax is closer to the human language. They use familiar English words, special characters and mathematical symbols in their syntax. So these languages are easier to write, read and understand. High level programs require compilers/interpreters to translate source code to machine language. We can compile the source code written in high level language to multiple machine languages. Thus, they are machine independent language. flutterjunction.com
High Level Language Advantages ● It is easier to write, debug and understand due to use of mnemonics. ● Execution is faster than high level languages ● It is efficient so is still in use for developing firmware, device driver. flutterjunction.com
High Level Language Advantages ● High level languages are programmer friendly. They are easy to write, debug and maintain. ● It provide higher level of abstraction from machine languages. ● It is machine independent language. ● Easy to learn. ● Less error prone, easy to find and debug errors. ● High level programming results in better programming productivity. flutterjunction.com
High Level Language Disadvantages ● It takes additional translation times to translate the source to machine code. ● High level programs are comparatively slower than low level programs. ● Compared to low level programs, they are generally less memory efficient. ● Cannot communicate directly with the hardware. flutterjunction.com
Program language translator A programming language translator is a program that converts code written in one programming language into another programming language. There are several types of programming language translators, including: a. Assembler b. Compiler c. Interpreter Programming language translators are an important part of the software development process, as they allow developers to write code in a programming language that is most suitable for their needs, and then translate it into a form that can be run on a computer. flutterjunction.com
Assembler An assembler is a program that translates assembly language, which is a low- level programming language, into machine code. Assembly language is a human- readable notation for the machine code that a computer's processor understands and executes. It is called "assembly" language because it involves using mnemonic codes to represent the instructions that the processor should execute, and then "assembling" them into machine code. The output of an assembler is usually a file containing machine code that can be loaded into a computer's memory and executed by the processor. flutterjunction.com
Compiler A compiler is a program that translates source code written in a high-level programming language into machine code that can be run on a computer. The source code is written by a programmer in a programming language such as C++, Python, or Java, and is then input into the compiler. The compiler translates the source code into machine code, which is a low-level, numerical representation of the instructions that the computer's processor can understand and execute. The machine code output by the compiler is usually stored in a file, which can then be loaded into the computer's memory and run. The process of using a compiler to translate source code into machine code is called "compiling." flutterjunction.com
Compiler flutterjunction.com
Interpreter An interpreter is a computer program that executes instructions written in a programming language. It reads a program, line by line, and executes each instruction as it is encountered. This is in contrast to a compiler, which reads a program and translates it into machine code that can be executed all at once. Some examples of programming languages that can be interpreted include Python, Ruby, and JavaScript. Both compiler and interpreters do the same job which is converting higher level programming language to machine code. However, a compiler will convert the code into machine code (create an exe) before program run. Interpreters convert code into machine code when the program is run. flutterjunction.com
Interpreter Vs Compiler flutterjunction.com Aspects Compiler Interpreter Execution Time Works at build time (before running the program). Works at run time (while the program is running). Translation Method Converts the entire code to machine code in one go. Translates and executes code line by line. Output Creates an executable file (e.g., .exe). No executable file is created.
Interpreter Vs Compiler flutterjunction.com Aspects Compiler Interpreter Speed Faster execution after compilation (pre-compiled). Slower, as it translates code during execution. Dependency Does not require the source code or compiler at runtime. Requires source code and interpreter at runtime. Examples C, C++ Python, JavaScript
Working Mechanism flutterjunction.com
Linkers and Loaders Linkers and loaders are the important part of any translator. For translating the source program there are certain activities happening into the memory which is called loading and linking. Linkers In high level programming languages, some built in functions are stored in header files or libraries. These libraries are predefined and contain basic functions which are essential for executing the program. These functions are linked to the libraries by a program called linker. A linker is a program that takes one or more object files generated by a compiler and combines them into a single executable file. An object file contains compiled code and data as well as symbolic information needed to link the file with other object files to create an executable. flutterjunction.com
Types of Linkers Static linkers: These linkers combine object files and libraries into a single executable file that is self-contained and does not require any external dependencies at runtime. Dynamic linkers: These linkers create executables that are linked to shared libraries, which are collections of object files that can be used by multiple programs. The executable file contains references to the shared libraries, and the dynamic linker resolves these references at runtime, when the program is loaded and executed. flutterjunction.com
x flutterjunction.com Programmin g Language Translator Linkers Loaders Object Code Exe file flutterjunction.com myproject.obj myproject.exe
Loaders It is a program that loads an executable file into memory and runs it. The executable file contains instructions that the processor can execute directly, but it also contains information that the operating system needs to set up the program's environment, such as memory allocations and other system resources. Loading a program involves reading the contents of executable file into memory. Once loading is complete, the operating system starts the program by passing control to the loaded program code. In many operating systems the loader is permanently resident in memory. flutterjunction.com
Types of Loaders Absolute loader: It is a primitive type of loader that executes only the loading function. It loads the object program from translation time address and simply transfers control to it. It doesn’t perform linking and program relocation. Bootstrap loader When the computer is turned on, bootstrap loader is executed. This loader is responsible for loading the operating system and transferring control to it. The bootstrap loader is present in the ROM area of main memory. flutterjunction.com
Types of Loaders Relocatable loader A Relocatable Loader is a type of program loader that handles the process of loading a program into memory while making necessary adjustments to the program's addresses to ensure it runs correctly in the memory location where it is loaded. flutterjunction.com
Key Responsibilities of Loaders Allocation The loader determines where in memory the program should be loaded. It allocates a block of memory in the system's available memory space, ensuring no overlap with other processes. The allocated memory depends on: Program size: Ensures enough memory for both code and data. System constraints: Considers memory availability and restrictions.
Key Responsibilities of Loaders Relocation Programs often contain addresses that depend on where in memory they will be loaded. A relocatable loader modifies these addresses to reflect the actual memory location at runtime. It adjusts addresses of instructions, data references, and symbols to the appropriate memory locations.
Types of Loaders Loading The loader places the program into the allocated memory space, ready for execution. Example: If a program assumes it will start at memory address 1000 but is loaded at address 2000, a relocatable loader updates all relevant addresses in the program to reflect the new starting address. flutterjunction.com
Example WorkFlow Loaders Allocation: The loader allocates memory at address 1000 for a program. Relocation: The program's internal address references (e.g., from 0 to 1000) are updated to reflect this allocation. Loading: The code, data, and stack sections are loaded into the allocated memory.
Generation of Computer Languages Computer languages can be classified into different generations based on the level of abstraction from the computer hardware. Each successive generation of languages provides higher level of abstraction, making it easier for developers to write programs and more portable across different hardware platforms. flutterjunction.com
First-generation languages (1GL) These are machine languages, which are directly executed by the computer's hardware and consist of binary digits (0s and 1s). Machine language is the only language that a computer can execute directly, but it is difficult for humans to read and write because it is made up of long strings of binary digits that have no relation to human languages. 1GL is considered the lowest-level programming language, and it is the most difficult to learn and use. It is also the least portable, as machine language varies from one type of computer to another. Programs written in 1GL are typically very efficient, because they can be executed directly by the computer's hardware with no need for translation. However, they are difficult to maintain and modify, and they are not reusable, so they are not widely used in modern programming. flutterjunction.com
Second generation languages (2GL) These are assembly languages, which are written using mnemonic codes that are easier for humans to read and write. These codes are then translated into machine language using an assembler. These are also known as "low-level" languages, are programming languages that are closer to machine code (binary) than high-level languages. They are typically used to write system-level software, such as operating systems, device drivers, and firmware. Some examples of second generation languages include assembly language and machine code. For example: FLOW-MATIC flutterjunction.com
Third-generation languages (3GL) These are high-level languages, such as C, C++, and Java, that are more abstract and closer to human languages. They are translated into machine language using a compiler or an interpreter. Third generation programming language also known as procedural oriented language was introduced to overcome the difficulties of 2gl. The essential feature of this generation language is hardware independence. Some examples are: ALGOL, COBOL, BASIC, LISP, FORTRAN etc. flutterjunction.com
Fourth-generation languages (4GL) These are even higher-level languages that are used to write specific types of programs, such as database queries or reports. These are also called object oriented programming. These are refinement in the style of 3GL. The aim of 4GL is to provide higher level of abstraction of the internal computer hardware and details, making the language more powerful, versatile and friendly to the programmer. Most of 4GL languages are used to get information from file and database. The mostly used software belongs to this group are: ORACLE, ORACLE developer 2000, foxpro for windows etc. these are SQL languages. flutterjunction.com
flutterjunction.com
Fifth-generation languages (5GL) These are the advanced generation of programming languages that are based on solving problems using constraints given to the program, rather than using an algorithm written by a programmer. Fourth generation programming languages are designed to build specific programs, where fifth generation programming languages are used to solve given problem even without a programmer. These are mainly used in AI, Graphics design, Animation technology etc. Examples include Prolog(PROgramming LOGing), Mercury, MAYA, CAD etc. flutterjunction.com
Machine (platform) Independent and Portability of Programs Machine independence and portability are important characteristics of a program. Machine independence means that a program can be executed on any machine, regardless of the hardware or operating system. This is useful because it allows the program to be used on a wide range of devices and systems, without the need to rewrite or recompile the code. Portability, on the other hand, refers to the ability of a program to be easily transferred from one machine to another and run without modification. This is useful in cases where you want to run the same program on multiple machines, or when you want to run the program on a different machine than the one it was originally developed on. flutterjunction.com
Machine (platform) Independent and Portability of Programs There are several ways to achieve machine independence and portability in a program. One way is to use a high-level programming language that is not tied to any particular hardware or operating system. For example, Python and Java are both high-level languages that are portable and can be run on a variety of different machines. flutterjunction.com
Some High Level Languages Python: Python is a popular, general-purpose programming language that is known for its simplicity and ease of use. It is used in a wide range of applications, including web development, scientific computing, and data analysis. Java: Java is a widely used, object-oriented programming language that is known for its portability and platform independence. It is used to develop a variety of applications, including mobile apps, web applications, and enterprise software. C++: C++ is a high-performance programming language that is widely used in the development of operating systems, compilers, and other system software. It is also used in the development of applications in a variety of domains, including gaming, finance, and engineering. flutterjunction.com
Some High Level Languages C#: C# is a modern, object-oriented programming language that is used to develop a variety of applications, including Windows desktop applications, mobile apps, and web applications. Ruby: Ruby is a dynamic, interpreted programming language that is used to develop web applications and other software. It is known for its simplicity and flexibility. flutterjunction.com

Unit 1 -Programming Languages(Programming Logic and Techniques)

  • 1.
  • 2.
    Chapter outline • Introduction •Analogy with Natural Language • Classification of Computer Languages • Program Language Translator • Linker and loader • Generation of Computer Languages • Machines Independent and Portability of Programs • Some Important Types of High-Level Language flutterjunction.com
  • 3.
    Introduction • Program: Aprogram is a set of instructions that a computer follows to perform a specific task. Programs are written in a programming language, which is a standardized set of rules and conventions for specifying the instructions that a computer should execute. Programs can be as simple as a series of instructions that tell a computer to perform a single task, or they can be much more complex, comprising hundreds or thousands of instructions that work together to perform a variety of tasks. • Software: Software is a general term for the various kinds of programs that run on a computer. It can include applications that perform specific tasks, such as word processing or graphics editing, as well as the operating system, which is the software that manages the computer's hardware and coordinates the various programs that run on the computer. flutterjunction.com
  • 4.
  • 5.
  • 6.
  • 7.
    Characteristics of GoodSoftware or Program • Integrity: Software integrity refers to the quality of the software’s source code. And, code quality is essential as it is a measure of how safe, secure, and reliable it is. • Clarity: The ability of the software to be easy to understand and use. • Simplicity: Software should be easy to understand and use. This means that the software should be straightforward and intuitive, and should not include unnecessary features or complexity. • Efficiency: the ability of the software to use resources effectively and to perform tasks quickly. Efficiency is important in software because it can improve the performance of the software and make it more effective. flutterjunction.com
  • 8.
    Characteristics of GoodSoftware or Program • Generality: The programs inside software should be general. • Modularity: Separate self contained modules should be in software to understand what is happening in software. • Robustness: Program must be fault tolerant. Robust software is able to handle a wide range of inputs and conditions without crashing or producing incorrect results. • Security: Program must be secure to avoid tampering from unwanted people. flutterjunction.com
  • 9.
    Computer language orprogramming language The world is controlled through the flow of information. The information can be communicated through various mediums like signals, sounds, music, certain key stocks (coding) etc. therefore the language is the means of communication so that people can easily understand the meaning. So the language is major element for the communication system. Language can be classified into 2 groups: 1. Natural Language 2. Computer language flutterjunction.com
  • 10.
    Types of ComputerLanguage Generally there are different kinds of computer languages, but they are generally grouped into two levels: ● Low level language ● High level language 1. Low level language A low-level programming language is a language that provides little or no abstraction from a computer's instruction set architecture. Low-level languages are closer to machine code, the code that is actually executed by a computer's central processing unit (CPU). Low-level languages are generally more difficult to read and write than high-level languages, which are closer to human languages and are designed to be easier for humans to read and write. flutterjunction.com
  • 11.
    Classification of Lowlevel Language 1. Machine language Machine language or machine code, is a low-level programming language that consists of binary digits (ones and zeros). It is the only language that a computer is capable of understanding and executing directly. Machine code is not human- readable and must be written in a hexadecimal or binary editor. Machine code is usually specific to a particular type of computer or processor, so code written in machine code will only run on the type of machine for which it was written. Machine code is the lowest level of programming language and is the foundation upon which all other programming languages are built. flutterjunction.com
  • 12.
    Classification of Lowlevel Language 1. Machine language Advantages ● It is faster in execution ● Has high efficiency ● Translators are not necessary to convert the language ● It can directly control hardware components of computer so high security can be maintained. flutterjunction.com
  • 13.
    Classification of Lowlevel Language 1. Machine language Disadvantages ● Machine dependent so program written for one processor cannot be used in ● others. ● Difficult to program due to the use of o and 1 ● Error prone ● Difficult to modify ● Time consuming and expensive, almost impossible to develop large program flutterjunction.com
  • 14.
    Classification of Lowlevel Language 2. Assembly Level Language Assembly language is a low-level programming language that is used to write programs that are executed directly by a computer's central processing unit (CPU). Assembly language is specific to a particular type of computer or processor, so code written in assembly language will only run on the type of machine for which it was written. Assembly language is generally more difficult to read and write than high- level languages, such as C and Python, but it provides more control over the hardware and can be used to write more efficient code. flutterjunction.com
  • 15.
    Classification of Lowlevel Language 2. Assembly Level Language The use of alphanumeric symbols called mnemonics codes are used so it is also called symbolic programming language. ADD, SUB, JMP, RET, EXIT, PRINT, MOD, LEVEL, START etc. The program written in Assembly level language should be converted in machine level language and the conversion is performed by an assembler. flutterjunction.com
  • 16.
    Classification of Lowlevel Language 1. Assembly Language Advantages ● It is easier to write, debug and understand due to use of mnemonics. ● Execution is faster than high level languages ● It is efficient so is still in use for developing firmware, device driver, operating system kernel. flutterjunction.com
  • 17.
    Classification of Lowlevel Language 1. Assembly Language Disadvantages ● It is also machine dependent. ● Program development and debugging is difficult and time consuming as compared to high level languages ● It is hard to remember the mnemonics flutterjunction.com
  • 18.
    High level language Toovercome the limitations of the low level programming languages lead to the development of high level programming language. High level programming languages are English like language and their syntax is closer to the human language. They use familiar English words, special characters and mathematical symbols in their syntax. So these languages are easier to write, read and understand. High level programs require compilers/interpreters to translate source code to machine language. We can compile the source code written in high level language to multiple machine languages. Thus, they are machine independent language. flutterjunction.com
  • 19.
    High Level Language Advantages ●It is easier to write, debug and understand due to use of mnemonics. ● Execution is faster than high level languages ● It is efficient so is still in use for developing firmware, device driver. flutterjunction.com
  • 20.
    High Level Language Advantages ●High level languages are programmer friendly. They are easy to write, debug and maintain. ● It provide higher level of abstraction from machine languages. ● It is machine independent language. ● Easy to learn. ● Less error prone, easy to find and debug errors. ● High level programming results in better programming productivity. flutterjunction.com
  • 21.
    High Level Language Disadvantages ●It takes additional translation times to translate the source to machine code. ● High level programs are comparatively slower than low level programs. ● Compared to low level programs, they are generally less memory efficient. ● Cannot communicate directly with the hardware. flutterjunction.com
  • 22.
    Program language translator Aprogramming language translator is a program that converts code written in one programming language into another programming language. There are several types of programming language translators, including: a. Assembler b. Compiler c. Interpreter Programming language translators are an important part of the software development process, as they allow developers to write code in a programming language that is most suitable for their needs, and then translate it into a form that can be run on a computer. flutterjunction.com
  • 23.
    Assembler An assembler isa program that translates assembly language, which is a low- level programming language, into machine code. Assembly language is a human- readable notation for the machine code that a computer's processor understands and executes. It is called "assembly" language because it involves using mnemonic codes to represent the instructions that the processor should execute, and then "assembling" them into machine code. The output of an assembler is usually a file containing machine code that can be loaded into a computer's memory and executed by the processor. flutterjunction.com
  • 24.
    Compiler A compiler isa program that translates source code written in a high-level programming language into machine code that can be run on a computer. The source code is written by a programmer in a programming language such as C++, Python, or Java, and is then input into the compiler. The compiler translates the source code into machine code, which is a low-level, numerical representation of the instructions that the computer's processor can understand and execute. The machine code output by the compiler is usually stored in a file, which can then be loaded into the computer's memory and run. The process of using a compiler to translate source code into machine code is called "compiling." flutterjunction.com
  • 25.
  • 26.
    Interpreter An interpreter isa computer program that executes instructions written in a programming language. It reads a program, line by line, and executes each instruction as it is encountered. This is in contrast to a compiler, which reads a program and translates it into machine code that can be executed all at once. Some examples of programming languages that can be interpreted include Python, Ruby, and JavaScript. Both compiler and interpreters do the same job which is converting higher level programming language to machine code. However, a compiler will convert the code into machine code (create an exe) before program run. Interpreters convert code into machine code when the program is run. flutterjunction.com
  • 27.
    Interpreter Vs Compiler flutterjunction.com AspectsCompiler Interpreter Execution Time Works at build time (before running the program). Works at run time (while the program is running). Translation Method Converts the entire code to machine code in one go. Translates and executes code line by line. Output Creates an executable file (e.g., .exe). No executable file is created.
  • 28.
    Interpreter Vs Compiler flutterjunction.com AspectsCompiler Interpreter Speed Faster execution after compilation (pre-compiled). Slower, as it translates code during execution. Dependency Does not require the source code or compiler at runtime. Requires source code and interpreter at runtime. Examples C, C++ Python, JavaScript
  • 29.
  • 30.
    Linkers and Loaders Linkersand loaders are the important part of any translator. For translating the source program there are certain activities happening into the memory which is called loading and linking. Linkers In high level programming languages, some built in functions are stored in header files or libraries. These libraries are predefined and contain basic functions which are essential for executing the program. These functions are linked to the libraries by a program called linker. A linker is a program that takes one or more object files generated by a compiler and combines them into a single executable file. An object file contains compiled code and data as well as symbolic information needed to link the file with other object files to create an executable. flutterjunction.com
  • 31.
    Types of Linkers Staticlinkers: These linkers combine object files and libraries into a single executable file that is self-contained and does not require any external dependencies at runtime. Dynamic linkers: These linkers create executables that are linked to shared libraries, which are collections of object files that can be used by multiple programs. The executable file contains references to the shared libraries, and the dynamic linker resolves these references at runtime, when the program is loaded and executed. flutterjunction.com
  • 32.
    x flutterjunction.com Programmin g Language Translator Linkers Loaders ObjectCode Exe file flutterjunction.com myproject.obj myproject.exe
  • 33.
    Loaders It is aprogram that loads an executable file into memory and runs it. The executable file contains instructions that the processor can execute directly, but it also contains information that the operating system needs to set up the program's environment, such as memory allocations and other system resources. Loading a program involves reading the contents of executable file into memory. Once loading is complete, the operating system starts the program by passing control to the loaded program code. In many operating systems the loader is permanently resident in memory. flutterjunction.com
  • 34.
    Types of Loaders Absoluteloader: It is a primitive type of loader that executes only the loading function. It loads the object program from translation time address and simply transfers control to it. It doesn’t perform linking and program relocation. Bootstrap loader When the computer is turned on, bootstrap loader is executed. This loader is responsible for loading the operating system and transferring control to it. The bootstrap loader is present in the ROM area of main memory. flutterjunction.com
  • 35.
    Types of Loaders Relocatableloader A Relocatable Loader is a type of program loader that handles the process of loading a program into memory while making necessary adjustments to the program's addresses to ensure it runs correctly in the memory location where it is loaded. flutterjunction.com
  • 36.
    Key Responsibilities ofLoaders Allocation The loader determines where in memory the program should be loaded. It allocates a block of memory in the system's available memory space, ensuring no overlap with other processes. The allocated memory depends on: Program size: Ensures enough memory for both code and data. System constraints: Considers memory availability and restrictions.
  • 37.
    Key Responsibilities ofLoaders Relocation Programs often contain addresses that depend on where in memory they will be loaded. A relocatable loader modifies these addresses to reflect the actual memory location at runtime. It adjusts addresses of instructions, data references, and symbols to the appropriate memory locations.
  • 38.
    Types of Loaders Loading Theloader places the program into the allocated memory space, ready for execution. Example: If a program assumes it will start at memory address 1000 but is loaded at address 2000, a relocatable loader updates all relevant addresses in the program to reflect the new starting address. flutterjunction.com
  • 39.
    Example WorkFlow Loaders Allocation: Theloader allocates memory at address 1000 for a program. Relocation: The program's internal address references (e.g., from 0 to 1000) are updated to reflect this allocation. Loading: The code, data, and stack sections are loaded into the allocated memory.
  • 40.
    Generation of ComputerLanguages Computer languages can be classified into different generations based on the level of abstraction from the computer hardware. Each successive generation of languages provides higher level of abstraction, making it easier for developers to write programs and more portable across different hardware platforms. flutterjunction.com
  • 41.
    First-generation languages (1GL) Theseare machine languages, which are directly executed by the computer's hardware and consist of binary digits (0s and 1s). Machine language is the only language that a computer can execute directly, but it is difficult for humans to read and write because it is made up of long strings of binary digits that have no relation to human languages. 1GL is considered the lowest-level programming language, and it is the most difficult to learn and use. It is also the least portable, as machine language varies from one type of computer to another. Programs written in 1GL are typically very efficient, because they can be executed directly by the computer's hardware with no need for translation. However, they are difficult to maintain and modify, and they are not reusable, so they are not widely used in modern programming. flutterjunction.com
  • 42.
    Second generation languages(2GL) These are assembly languages, which are written using mnemonic codes that are easier for humans to read and write. These codes are then translated into machine language using an assembler. These are also known as "low-level" languages, are programming languages that are closer to machine code (binary) than high-level languages. They are typically used to write system-level software, such as operating systems, device drivers, and firmware. Some examples of second generation languages include assembly language and machine code. For example: FLOW-MATIC flutterjunction.com
  • 43.
    Third-generation languages (3GL) Theseare high-level languages, such as C, C++, and Java, that are more abstract and closer to human languages. They are translated into machine language using a compiler or an interpreter. Third generation programming language also known as procedural oriented language was introduced to overcome the difficulties of 2gl. The essential feature of this generation language is hardware independence. Some examples are: ALGOL, COBOL, BASIC, LISP, FORTRAN etc. flutterjunction.com
  • 44.
    Fourth-generation languages (4GL) Theseare even higher-level languages that are used to write specific types of programs, such as database queries or reports. These are also called object oriented programming. These are refinement in the style of 3GL. The aim of 4GL is to provide higher level of abstraction of the internal computer hardware and details, making the language more powerful, versatile and friendly to the programmer. Most of 4GL languages are used to get information from file and database. The mostly used software belongs to this group are: ORACLE, ORACLE developer 2000, foxpro for windows etc. these are SQL languages. flutterjunction.com
  • 45.
  • 46.
    Fifth-generation languages (5GL) Theseare the advanced generation of programming languages that are based on solving problems using constraints given to the program, rather than using an algorithm written by a programmer. Fourth generation programming languages are designed to build specific programs, where fifth generation programming languages are used to solve given problem even without a programmer. These are mainly used in AI, Graphics design, Animation technology etc. Examples include Prolog(PROgramming LOGing), Mercury, MAYA, CAD etc. flutterjunction.com
  • 47.
    Machine (platform) Independentand Portability of Programs Machine independence and portability are important characteristics of a program. Machine independence means that a program can be executed on any machine, regardless of the hardware or operating system. This is useful because it allows the program to be used on a wide range of devices and systems, without the need to rewrite or recompile the code. Portability, on the other hand, refers to the ability of a program to be easily transferred from one machine to another and run without modification. This is useful in cases where you want to run the same program on multiple machines, or when you want to run the program on a different machine than the one it was originally developed on. flutterjunction.com
  • 48.
    Machine (platform) Independentand Portability of Programs There are several ways to achieve machine independence and portability in a program. One way is to use a high-level programming language that is not tied to any particular hardware or operating system. For example, Python and Java are both high-level languages that are portable and can be run on a variety of different machines. flutterjunction.com
  • 49.
    Some High LevelLanguages Python: Python is a popular, general-purpose programming language that is known for its simplicity and ease of use. It is used in a wide range of applications, including web development, scientific computing, and data analysis. Java: Java is a widely used, object-oriented programming language that is known for its portability and platform independence. It is used to develop a variety of applications, including mobile apps, web applications, and enterprise software. C++: C++ is a high-performance programming language that is widely used in the development of operating systems, compilers, and other system software. It is also used in the development of applications in a variety of domains, including gaming, finance, and engineering. flutterjunction.com
  • 50.
    Some High LevelLanguages C#: C# is a modern, object-oriented programming language that is used to develop a variety of applications, including Windows desktop applications, mobile apps, and web applications. Ruby: Ruby is a dynamic, interpreted programming language that is used to develop web applications and other software. It is known for its simplicity and flexibility. flutterjunction.com