Object Code Forms in Compilation
In the final phase of a compiler, the intermediate representation of the source program is translated
into object code — a low-level form of code that can be executed by a computer. The form of object
code generated depends on the compiler design, the target system, and the way the compiled code
is expected to be used. There are three major forms in which object code can be generated:
1. Absolute Machine Code
Absolute machine code is a fully-resolved and directly executable form of machine code. All the
addresses of instructions and data are hardcoded and fixed during compilation. Once generated, this
code can be loaded at a specific memory location and run without any further processing such as
linking or relocation.
This form of object code is simple and fast, making it suitable for small, standalone applications or
educational tools like WATFIV or PL/C.
Advantages:
• No need for a linker or loader.
• Ideal for small and quick compilation tasks.
Limitations:
• Lack of flexibility — the program must always be loaded at the same memory address.
• Difficult to support modular programming or reuse components.
2. Relocatable Object Code
Relocatable object code is designed to allow independent modules of a program to be compiled
separately and then linked together into a complete executable. Instead of using fixed memory
addresses, this code contains symbolic references and relocation information that a linker uses to
determine final addresses at link or load time.
This form is widely used in modern software development, where large applications are developed in
a modular way and recompiled in parts.
Advantages:
• Supports modular programming and separate compilation.
• Enables code reuse through libraries.
• Allows programs to be loaded into any memory location.
Requirements:
• A separate linking process is required.
• May also require a loader to load the linked program into memory.
3. Assembly Language Code
Assembly language code is a human-readable, symbolic version of machine code. It uses instructions
like MOV, ADD, and symbolic labels like LOOP: instead of binary codes. Assembly code must be
passed through an assembler to produce machine-level object code.
This form is useful for system-level programming, performance tuning, or debugging, where visibility
and control over hardware-level operations are necessary.
Advantages:
• Easier to understand and debug than binary code.
• Allows use of macros, symbolic names, and comments.
• Ideal for embedded systems and OS-level components.
Limitations:
• Not directly executable — needs assembly and linking.
• Less portable than high-level code.
Comparison of Object Code Forms
Executable Linking
Code Form Readable Typical Use Case
Directly Required
Absolute Machine Educational tools, small
No Yes No
Code programs
Modular and large-scale
Relocatable Code No No Yes
software
System/embedded
Assembly Code Yes No Yes (after ASM)
programming
Conclusion
Each form of object code has its own role and relevance depending on the goals of the compiler and
the application domain. Absolute machine code is best for fast, single-shot compilation and
execution. Relocatable object code supports modern development workflows involving modularity
and dynamic linking. Assembly language offers clarity and low-level control, crucial for system and
embedded development. Understanding these forms helps in designing efficient, flexible, and
maintainable compiler architectures.