Object program is aa)Program written in machine languageb)Program to b...
Explanation: Since the input is the source language and the output that we get after the analysis is the machine language.
View all questions of this test
Object program is aa)Program written in machine languageb)Program to b...
Translation of high-level language into machine language
Explanation:
An object program is a program that has been translated from a high-level programming language into machine language. It is the result of the compilation process, where the source code written in a high-level language is converted into a low-level language, which can be understood and executed by the computer's hardware.
Object Program:
An object program is typically generated by a compiler or an assembler. It consists of a sequence of machine instructions and data that can be directly executed by the computer. The object program is usually stored in a file format that is specific to the target machine or operating system.
Process of Translation:
The translation process involves several stages:
1. Lexical analysis: The source code is divided into tokens, such as keywords, identifiers, operators, and literals.
2. Syntax analysis: The tokens are arranged according to the rules of the programming language's grammar to create a parse tree or syntax tree.
3. Semantic analysis: The compiler checks the correctness of the program's semantics, such as variable declarations, type checking, and function calls.
4. Code generation: The compiler generates the equivalent machine code for each statement in the source code.
5. Optimization: The compiler may apply various optimization techniques to improve the efficiency of the generated code.
6. Linking: If the program consists of multiple source files, the compiler links them together to create a single executable object program.
Advantages of Object Program:
- Object programs are efficient because they are written in the machine language, which is directly understood by the computer's hardware.
- Object programs are portable, as they can be executed on any computer that supports the target machine or operating system.
- Object programs are secure because the source code is not accessible to the end-user, preventing potential code theft or modification.
In conclusion, an object program is the translation of a high-level programming language into machine language. It is the result of the compilation process and consists of machine instructions and data that can be directly executed by the computer.
To make sure you are not studying endlessly, EduRev has designed Computer Science Engineering (CSE) study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Computer Science Engineering (CSE).