Object code: Difference between revisions
imported>Dawnseeker2000 m date format audit, minor formatting, refine ref details, unlink common terms |
(No difference)
|
Latest revision as of 05:24, 11 April 2025
Template:Short description Template:Distinguish Template:Use dmy dates Template:Program execution In computing, object code or object module is the product of an assembler or compiler.<ref>Template:Cite web</ref>
In a general sense, object code is a sequence of statements or instructions in a computer language,<ref>Template:Cite book</ref> usually a machine code language (i.e., binary) or an intermediate language such as register transfer language (RTL). The term indicates that the code is the goal or result of the compiling process, with some early sources referring to source code as a "subject program".Template:Citation needed
Details
[edit]Object files can in turn be linked to form an executable file or library file. In order to be used, object code must either be placed in an executable file, a library file, or an object file.
Object code is a portion of machine code that has not yet been linked into a complete program. It is the machine code for one particular library or module that will make up the completed product. It may also contain placeholders or offsets, not found in the machine code of a completed program, that the linker will use to connect everything together. Whereas machine code is binary code that can be executed directly by the CPU, object code has the jumps and inter-module references partially parametrized so that a linker can fill them in. An object file is assumed to begin at a specific location in memory, often zero. It contains information on instructions that reference memory, so that the linker can relocate the code when combining multiple object files into a single program.
An assembler is used to convert assembly code into machine code (object code). A linker links several object (and library) files to generate an executable. Assemblers (and some compilers) can also assemble directly to machine code to produce executable files without the object intermediary step.<ref>Template:Cite web</ref>