Skip to content
Part IA Lent Term

Address Binding

What is address binding?

A programme contains references to memory addresses — function calls, global variables, branch targets. Address binding is the process of resolving these symbolic or relocatable references to actual physical memory addresses. Binding can happen at three different stages.

Compile-time binding

If the compiler knows exactly where the programme will reside in physical memory at run time (e.g., address 0x1000), it can emit absolute physical addresses directly in the machine code. This was common in early single-tasking systems (MS-DOS .com files) and in embedded systems.

  • Hardware requirement: None.
  • Flexibility: The programme must be loaded at that exact address. If the address is already occupied, the programme cannot run.
  • Relocation: Impossible — the programme must be recompiled for a different address.

Load-time binding

The compiler generates relocatable code. At load time, the loader (part of the OS) adjusts all absolute addresses by adding the base address where the programme was actually loaded.

  • Hardware requirement: None beyond the ability to write to memory. The loader performs address arithmetic before the programme starts.
  • Flexibility: The programme can be loaded at any free contiguous region of memory. Once loaded and bound, it cannot be moved.
  • Relocation: Requires reloading — swap out, load at new address, rebind.

Execution-time binding

Binding is deferred until each memory access occurs. The hardware (MMU) performs logical-to-physical translation on every memory reference using a page table or base/limit registers. The programme’s addresses are logical (virtual); physical addresses are computed at run time.

  • Hardware requirement: An MMU with a page table (paging) or base/limit registers (segmentation).
  • Flexibility: The programme can be moved transparently by changing the page table. The same logical address can map to different physical frames at different times (swapping). Two processes can share the same page of physical memory by mapping it into both address spaces.
  • Cost: Every memory access pays the overhead of translation (cached by the TLB).

Three stages of address binding: compile-time, load-time, and execution-time binding

The binding spectrum

StageWhenHardware neededCan move after loading?
Compile timeCompiler emits absolute addressesNoneNo — must reload at same address
Load timeLoader patches addressesLoader (software)No — bound addresses are fixed
Execution timeMMU on every accessMMU (page table or base/limit)Yes — change page-table mappings

All modern general-purpose OSes use execution-time binding. Compile-time and load-time binding appear only in constrained embedded systems or historical contexts.

Significance for the Tripos

The exam asks you to describe the three stages, what hardware is required, and the implications for relocation. The key insight: only execution-time binding allows a programme to be moved in physical memory while it is running — the logical addresses stay the same, while the MMU silently changes the physical mapping.


Past Paper Questions

2024 Paper 2 Question 4(a): Address binding refers to the process of resolving memory references in a programme to physical addresses. Describe what is required for it to happen at compile time, at load time, and during execution. [3 marks]